MeVisLab Toolbox Reference
|
Class defining a tag used in the MLImageFormat class. More...
#include <mlImageFormatTag.h>
Public Member Functions | |
Basic class stuff, constructor, destructor, assignment etc. | |
MLImageFormatTag () | |
Default constructor, setting name and value to empty strings. More... | |
MLImageFormatTag (const MLImageFormatTag &tag) | |
Copy constructor. More... | |
MLImageFormatTag (const std::string &name, const std::string &value) | |
Constructor from name and value. More... | |
MLImageFormatTag (const std::string &name, MLint value) | |
Constructor from name and MLint. More... | |
MLImageFormatTag (const std::string &name, MLdouble value) | |
Constructor from name and MLdouble. More... | |
MLImageFormatTag (const std::string &name, MLldouble value) | |
Constructor from name and MLldouble. More... | |
MLImageFormatTag & | operator= (const MLImageFormatTag &tag) |
Assignment operator. More... | |
Methods to set the value from different types. | |
const std::string & | getName () const |
Returns the tag name as string. More... | |
const std::string & | getValue () const |
Returns the value as string. More... | |
void | setName (const std::string &newName) |
Method to set the value from an MLint64. More... | |
void | setValue (const std::string &newVal) |
Method to set the value from a string. More... | |
void | setValue (MLint newVal) |
Method to set the value from an MLint64. More... | |
void | setValue (MLdouble newVal) |
Method to set the value from a double. More... | |
void | setValue (MLldouble newVal) |
Method to set the value from a long double. More... | |
size_t | getTagSize () const |
Return the size of name and value strings + 2 for the two terminating nulls. More... | |
void | writeNameAndValueIntoMemory (char *memPos) const |
Write name and tag terminated with null characters to the memory position memPos. More... | |
const char * | setNameAndValueFromMemory (const char *mem, const char *lastValidMemByte) |
Set 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 describing the name of the tag, the second describing the value string of the tag. More... | |
Methods to get the value as different types. | |
const std::string & | getStringValue () const |
Method to set the value from an MLint64. More... | |
MLint | getMLintValue () const |
Method to get the value as an MLint or 0 on failure. More... | |
MLdouble | getDoubleValue () const |
Method to get the value as a double or 0 on failure. More... | |
MLldouble | getLongDoubleValue () const |
Method to get the value as a long double or 0 on failure. More... | |
Protected Attributes | |
std::string | _name |
The name of the tag to be stored in a file; default is "". More... | |
std::string | _value |
The value of the tag to be stored in a file; default is "". More... | |
Class defining a tag used in the MLImageFormat class.
Definition at line 30 of file mlImageFormatTag.h.
|
inline |
Default constructor, setting name and value to empty strings.
Definition at line 38 of file mlImageFormatTag.h.
|
inline |
Copy constructor.
Definition at line 44 of file mlImageFormatTag.h.
|
inline |
Constructor from name and value.
Definition at line 50 of file mlImageFormatTag.h.
|
inline |
Constructor from name and MLint.
Definition at line 57 of file mlImageFormatTag.h.
|
inline |
Constructor from name and MLdouble.
Definition at line 64 of file mlImageFormatTag.h.
|
inline |
Constructor from name and MLldouble.
Definition at line 71 of file mlImageFormatTag.h.
|
inline |
Method to get the value as a double or 0 on failure.
Definition at line 242 of file mlImageFormatTag.h.
|
inline |
Method to get the value as a long double or 0 on failure.
Definition at line 251 of file mlImageFormatTag.h.
|
inline |
Method to get the value as an MLint or 0 on failure.
Definition at line 233 of file mlImageFormatTag.h.
|
inline |
Returns the tag name as string.
Definition at line 95 of file mlImageFormatTag.h.
Referenced by ml::operator!=(), and ml::operator==().
|
inline |
Method to set the value from an MLint64.
Definition at line 227 of file mlImageFormatTag.h.
|
inline |
Return the size of name and value strings + 2 for the two terminating nulls.
Definition at line 152 of file mlImageFormatTag.h.
|
inline |
Returns the value as string.
Definition at line 98 of file mlImageFormatTag.h.
Referenced by ml::operator!=(), and ml::operator==().
|
inline |
Assignment operator.
Definition at line 78 of file mlImageFormatTag.h.
|
inline |
Method to set the value from an MLint64.
Definition at line 101 of file mlImageFormatTag.h.
|
inline |
Set 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 describing the name of the tag, the second describing 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 | is 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. |
Definition at line 186 of file mlImageFormatTag.h.
|
inline |
Method to set the value from a string.
Definition at line 110 of file mlImageFormatTag.h.
|
inline |
Method to set the value from a double.
Definition at line 124 of file mlImageFormatTag.h.
|
inline |
Method to set the value from an MLint64.
Definition at line 116 of file mlImageFormatTag.h.
|
inline |
Method to set the value from a long double.
Definition at line 138 of file mlImageFormatTag.h.
|
inline |
Write 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.
Definition at line 160 of file mlImageFormatTag.h.
|
protected |
The name of the tag to be stored in a file; default is "".
Definition at line 262 of file mlImageFormatTag.h.
Referenced by operator=().
|
protected |
The value of the tag to be stored in a file; default is "".
Definition at line 265 of file mlImageFormatTag.h.
Referenced by operator=().