|
MeVisLab Toolbox Reference
|
Class defining a tag used in the MLImageFormat class. More...
#include <mlImageFormatTag.h>
Public Member Functions | |
Basic class elements, constructor, destructor, assignment, etc. | |
| MLImageFormatTag ()=default | |
| Default constructor, setting name and value to empty strings. | |
| MLImageFormatTag (std::string name, std::string value) | |
| Constructor from name and value. | |
| MLImageFormatTag (std::string name, MLint value) | |
| Constructor from name and MLint. | |
| MLImageFormatTag (std::string name, MLdouble value) | |
| Constructor from name and MLdouble. | |
| MLImageFormatTag (std::string name, MLldouble value) | |
| Constructor from name and MLldouble. | |
Methods to set the value from different types. | |
| const std::string & | getName () const |
| Returns the tag name as string. | |
| const std::string & | getValue () const |
| Returns the value as string. | |
| void | setName (const std::string &newName) |
| Sets the value from an MLint64. | |
| void | setValue (const std::string &newVal) |
| Sets the value from a string. | |
| void | setValue (MLint newVal) |
| Sets the value from an MLint64. | |
| void | setValue (MLdouble newVal) |
| Sets the value from a double. | |
| void | setValue (MLldouble newVal) |
| Sets the value from a long double. | |
| size_t | getTagSize () const |
| Returns the size of name and value strings + 2 for the two terminating nulls. | |
| void | writeNameAndValueIntoMemory (char *memPos) const |
| const char * | setNameAndValueFromMemory (const char *mem, const char *lastValidMemByte) |
Methods to get the value as different types. | |
| const std::string & | getStringValue () const |
| Sets the value from an MLint64. | |
| MLint | getMLintValue () const |
| Sets the value as an MLint or 0 on failure. | |
| MLdouble | getDoubleValue () const |
| Returns the value as a double or 0 on failure. | |
| MLldouble | getLongDoubleValue () const |
| Returns the value as a long double or 0 on failure. | |
Protected Attributes | |
| std::string | _name |
| The name of the tag to be stored in a file; default is "". | |
| std::string | _value |
| The value of the tag to be stored in a file; default is "". | |
Class defining a tag used in the MLImageFormat class.
Definition at line 32 of file mlImageFormatTag.h.
|
default |
Default constructor, setting name and value to empty strings.
|
inline |
Constructor from name and value.
Definition at line 43 of file mlImageFormatTag.h.
|
inline |
Constructor from name and MLint.
Definition at line 49 of file mlImageFormatTag.h.
References _name, and setValue().
|
inline |
Constructor from name and MLdouble.
Definition at line 56 of file mlImageFormatTag.h.
References _name, and setValue().
|
inline |
Constructor from name and MLldouble.
Definition at line 63 of file mlImageFormatTag.h.
References _name, and setValue().
| MLdouble ml::MLImageFormatTag::getDoubleValue | ( | ) | const |
Returns the value as a double or 0 on failure.
| MLldouble ml::MLImageFormatTag::getLongDoubleValue | ( | ) | const |
Returns the value as a long double or 0 on failure.
|
inline |
|
inline |
Sets the value from an MLint64.
Definition at line 140 of file mlImageFormatTag.h.
References _value.
|
inline |
Returns the size of name and value strings + 2 for the two terminating nulls.
Definition at line 102 of file mlImageFormatTag.h.
|
inline |
|
inline |
| const char * ml::MLImageFormatTag::setNameAndValueFromMemory | ( | const char * | mem, |
| const char * | lastValidMemByte ) |
Sets tag and value from a memory buffer which is assumed to contain two NULL-terminated strings directly after another, separated by a null-terminating character. The first describes the name of the tag, the second describes the value string of the tag. Note that this function also supports empty name and value strings; that means that two null terminating characters after each other are parsed correctly. In case of failure, name and value of *this are not modified.
| mem | The pointer to the first character of the name of the tag to be parsed from memory. |
| lastValidMemByte | Must be a pointer to the last byte of the memory buffer, which may be parsed by this function. It will not be exceeded while reading the name and value. It must be equal or larger than the pointer to the null-terminating character of the value string. |
|
inline |
Sets the value from a string.
Definition at line 90 of file mlImageFormatTag.h.
References _value.
Referenced by MLImageFormatTag(), MLImageFormatTag(), and MLImageFormatTag().
| void ml::MLImageFormatTag::setValue | ( | MLdouble | newVal | ) |
Sets the value from a double.
| void ml::MLImageFormatTag::setValue | ( | MLldouble | newVal | ) |
Sets the value from a long double.
| void ml::MLImageFormatTag::writeNameAndValueIntoMemory | ( | char * | memPos | ) | const |
Writes name and tag terminated with null characters to the memory position memPos. It is assumed that at memPos, at least getTagSize() bytes of accessible memory is available.
|
protected |
The name of the tag to be stored in a file; default is "".
Definition at line 154 of file mlImageFormatTag.h.
Referenced by getName(), getTagSize(), MLImageFormatTag(), MLImageFormatTag(), MLImageFormatTag(), MLImageFormatTag(), and setName().
|
protected |
The value of the tag to be stored in a file; default is "".
Definition at line 157 of file mlImageFormatTag.h.
Referenced by getStringValue(), getTagSize(), getValue(), MLImageFormatTag(), and setValue().