libkazv
Kazv::FileDesc Class Reference

#include <file-desc.hpp>

Public Member Functions

 FileDesc (FileContent content)
 Construct an in-memory FileDesc with content. More...
 
 FileDesc (std::string name, std::optional< std::string > contentType=std::nullopt)
 Construct a FileDesc with name and contentType. More...
 
FileProvider provider (const FileInterface &fh) const
 Get the FileProvider for this FileDesc using FileInterface. More...
 
std::optional< std::string > name () const
 Get the name for this FileDesc. More...
 
std::optional< std::string > contentType () const
 Get the content type for this FileDesc. More...
 
bool operator== (const FileDesc &that) const
 

Constructor & Destructor Documentation

◆ FileDesc() [1/2]

Kazv::FileDesc::FileDesc ( FileContent  content)
inlineexplicit

Construct an in-memory FileDesc with content.

◆ FileDesc() [2/2]

Kazv::FileDesc::FileDesc ( std::string  name,
std::optional< std::string >  contentType = std::nullopt 
)
inlineexplicit

Construct a FileDesc with name and contentType.

Member Function Documentation

◆ contentType()

std::optional<std::string> Kazv::FileDesc::contentType ( ) const
inline

Get the content type for this FileDesc.

◆ name()

std::optional<std::string> Kazv::FileDesc::name ( ) const
inline

Get the name for this FileDesc.

◆ operator==()

bool Kazv::FileDesc::operator== ( const FileDesc that) const

◆ provider()

FileProvider Kazv::FileDesc::provider ( const FileInterface fh) const

Get the FileProvider for this FileDesc using FileInterface.

If this is an in-memory file, this will always return a DumbFileProvider. Otherwise, it will return what fh.getProviderFor(*this) returns.

Returns
a FileProvider for this.

The documentation for this class was generated from the following files: