|
CeresEngine 0.2.0
A game development framework
|
A class that parses, handles and encapsulates a MIME-like content type. More...
#include <CeresEngine/Foundation/ContentType.hpp>
Public Member Functions | |
| ContentType () | |
| Creates a empty FileContentType object. | |
| ContentType (StringView type) | |
| Creates a new content type by parsing a content type string. | |
| ContentType & | operator= (StringView contentType) |
| Assigns the content type by parsing the assigned string. | |
| ContentType (const char *type) | |
| Creates a new content type by parsing a content type string. | |
| ContentType (String type, String subtype, String tree={}, String suffix={}, Map< String, String > parameters={}) noexcept | |
| Creates a new content type from its individual parts. | |
| ContentType (String type, String subtype, Map< String, String > parameters) noexcept | |
| Creates a new content type from its type, subtype and parameters. | |
| ContentType (const ContentType &other) | |
| Creates a new content type by copying the contents of another. | |
| ContentType & | operator= (const ContentType &other) |
| Assigns the content type by copying the contents of another. | |
| ContentType (ContentType &&other) noexcept | |
| Creates a new content type by moving the contents of another. | |
| ContentType & | operator= (ContentType &&other) noexcept |
| Assigns the content type by moving the contents of another. | |
| const String & | getType () const |
| void | setType (String type) |
| Set the type. | |
| const String & | getTree () const |
| void | setTree (String tree) |
| Set the tree. | |
| const String & | getSubtype () const |
| void | setSubtype (String subtype) |
| Set the subtype. | |
| const String & | getSuffix () const |
| void | setSuffix (String suffix) |
| Set the suffix. | |
| const Map< String, String > & | getParameters () const |
| void | setParameters (Map< String, String > parameters) |
| Set the parameters. | |
| const String & | getParameter (const String &name) const |
| void | setParameter (const String &name, String value) |
| Set a parameter. | |
| bool | empty () const |
| bool | emptyTree () const |
| bool | emptyType () const |
| bool | emptySubtype () const |
| bool | emptySuffix () const |
| bool | emptyParameters () const |
| operator bool () const | |
| Validate object in a boolean context: !empty. | |
| String | toString () const |
Creates a string representation as "type[/subtype]". | |
| bool | operator== (const ContentType &other) const |
| Checks if two contents types are equal. | |
| bool | operator!= (const ContentType &other) const |
| Checks if two contents types are not equal. | |
| bool | operator< (const ContentType &other) const |
| A lexicographical comparison for a content type. | |
| bool | operator<= (const ContentType &other) const |
| A lexicographical comparison for a content type. | |
| bool | operator> (const ContentType &other) const |
| A lexicographical comparison for a content type. | |
| bool | operator>= (const ContentType &other) const |
| A lexicographical comparison for a content type. | |
Private Member Functions | |
| void | parse (StringView str) |
| Parses the file content type. | |
Private Attributes | |
| String | mType |
| The content type "type" field. | |
| String | mTree |
| The content type "tree" field. | |
| String | mSubtype |
| The content type "subtype" field. | |
| String | mSuffix |
| The content type "suffix" field. | |
| Map< String, String > | mParameters |
| The content type parameters. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| std::ostream & | operator<< (std::ostream &str, const ContentType &obj) |
| Stream output. | |
A class that parses, handles and encapsulates a MIME-like content type.
| CeresEngine::ContentType::ContentType | ( | ) |
Creates a empty FileContentType object.
|
explicit |
Creates a new content type by parsing a content type string.
| type | the content type string to parse from. |
| std::invalid_argument | if string is malformed |
Creates a new content type by parsing a content type string.
| type | the content type string to parse from. |
| std::invalid_argument | if string is malformed |
|
noexcept |
Creates a new content type from its individual parts.
| type | the content type |
| subtype | the content subtype |
| tree | the content type tree |
| suffix | the content type suffix |
| parameters | the content type parameters |
|
noexcept |
Creates a new content type from its type, subtype and parameters.
| type | the content type |
| subtype | the content subtype |
| parameters | the content type parameters |
| CeresEngine::ContentType::ContentType | ( | const ContentType & | other | ) |
Creates a new content type by copying the contents of another.
| other | the instance to copy from |
|
noexcept |
Creates a new content type by moving the contents of another.
| other | the instance to move from |
| bool CeresEngine::ContentType::empty | ( | ) | const |
| bool CeresEngine::ContentType::emptyParameters | ( | ) | const |
| bool CeresEngine::ContentType::emptySubtype | ( | ) | const |
| bool CeresEngine::ContentType::emptySuffix | ( | ) | const |
| bool CeresEngine::ContentType::emptyTree | ( | ) | const |
| bool CeresEngine::ContentType::emptyType | ( | ) | const |
| name | the parameter name to get a value for |
name.
|
explicit |
Validate object in a boolean context: !empty.
empty() is false. | bool CeresEngine::ContentType::operator!= | ( | const ContentType & | other | ) | const |
Checks if two contents types are not equal.
| other | the content type to check against |
| bool CeresEngine::ContentType::operator< | ( | const ContentType & | other | ) | const |
A lexicographical comparison for a content type.
| other | the content type to compare against |
| bool CeresEngine::ContentType::operator<= | ( | const ContentType & | other | ) | const |
A lexicographical comparison for a content type.
| other | the content type to compare against |
| ContentType & CeresEngine::ContentType::operator= | ( | const ContentType & | other | ) |
Assigns the content type by copying the contents of another.
| other | the instance to copy from |
|
noexcept |
Assigns the content type by moving the contents of another.
| other | the instance to move from |
| ContentType & CeresEngine::ContentType::operator= | ( | StringView | contentType | ) |
Assigns the content type by parsing the assigned string.
| contentType | the content type to be parsed. |
| std::invalid_argument | if string is malformed |
| bool CeresEngine::ContentType::operator== | ( | const ContentType & | other | ) | const |
Checks if two contents types are equal.
| other | the content type to check against |
| bool CeresEngine::ContentType::operator> | ( | const ContentType & | other | ) | const |
A lexicographical comparison for a content type.
| other | the content type to compare against |
| bool CeresEngine::ContentType::operator>= | ( | const ContentType & | other | ) | const |
A lexicographical comparison for a content type.
| other | the content type to compare against |
|
private |
Parses the file content type.
| str | the content type string to be parsed |
Set a parameter.
| name | the parameter name to set a value for |
| value | the parameter value |
| std::invalid_argument | if string is malformed |
Set the parameters.
| parameters | the parameters to be set |
| std::invalid_argument | if string is malformed |
Set the subtype.
| subtype | the subtype to be set |
| std::invalid_argument | if string is malformed |
Set the suffix.
| suffix | the suffix to be set |
| std::invalid_argument | if string is malformed |
Set the tree.
| tree | the tree to be set |
| std::invalid_argument | if string is malformed |
Set the type.
| type | the type to be set |
| std::invalid_argument | if string is malformed |
| String CeresEngine::ContentType::toString | ( | ) | const |
Creates a string representation as "type[/subtype]".
|
related |
Stream output.
|
private |
The content type "subtype" field.
|
private |
The content type "suffix" field.
|
private |
The content type "tree" field.
|
private |
The content type "type" field.