Class ContentSource#

Class Documentation#

class ContentSource#

Helper for content coming from a file or in-memory string.

This class has implicit conversions from the standard string and filepath types for convenience.

Public Functions

ContentSource() = default#

Constructor for an empty ContentSource.

ContentSource(const ContentSource &other)#

Copy Constructor for ContentSource.

Parameters:

other – - the ContentSource to copy

ContentSource(ContentSource &&other) noexcept#

Move Constructor for ContentSource.

Parameters:

other – - the ContentSource to move

ContentSource(std::filesystem::path source)#

ContentSource std::filesystem::path conversion constructor.

Parameters:

source – - path to the file containing the content

ContentSource(std::string_view source)#

ContentSource std::string_view conversion constructor.

Parameters:

source – - string containing a filepath or content

ContentSource(const char *source)#

ContentSource char* conversion constructor.

Parameters:

source – - string containing a filepath or content

ContentSource(const std::string &source)#

ContentSource std::string conversion constructor.

Parameters:

source – - string containing a filepath or content

ContentSource(std::string &&source)#

ContentSource rvalue std::string conversion constructor.

Parameters:

source – - string containing a filepath or content

std::string_view getContent() const#

Get the given string or file content.

Returns:

The content

operator bool() const#

Whether there is any content.

Returns:

Whether there is any content