NexusCPP  3.5.0
Public Types | Public Member Functions | List of all members
nxcpp::MMetadata Class Reference

Mix-in that add metadata capabilitie to objects. More...

#include <nxwriter.h>

Inheritance diagram for nxcpp::MMetadata:
Inheritance graph
[legend]

Public Types

enum  Type {
  NONE = 0, STRING, INT, LONGINT,
  DOUBLE
}
 

Public Member Functions

void AddMetadata (const std::string &strKey, const std::string &strValue)
 
void AddMetadata (const std::string &strKey, const char *pszValue)
 
void AddMetadata (const std::string &strKey, int iValue)
 
void AddMetadata (const std::string &strKey, long lValue)
 
void AddMetadata (const std::string &strKey, double dValue)
 
bool HasMetadata (const std::string &strKey) const
 
bool GetMetadata (const std::string &strKey, std::string *pstrValue, bool bThrow=true) const
 
bool GetStringMetadata (const std::string &strKey, std::string *pstrValue, bool bThrow=true) const
 
std::string StringMetadata (const std::string &strKey) const
 
bool GetIntegerMetadata (const std::string &strKey, int *piValue, bool bThrow=true) const
 
int IntegerMetadata (const std::string &strKey) const
 
bool GetLongIntegerMetadata (const std::string &strKey, long *plValue, bool bThrow=true) const
 
long LongIntegerMetadata (const std::string &strKey) const
 
bool GetDoubleMetadata (const std::string &strKey, double *pdValue, bool bThrow=true) const
 
double DoubleMetadata (const std::string &strKey) const
 
Type GetMetadataType (const std::string &strKey, bool bThrow=true) const
 
std::list< std::string > MetadataKeys () const
 Returns the metadata keys std::list. More...
 
void ClearMetadata ()
 Clear all metadata. More...
 

Detailed Description

Mix-in that add metadata capabilitie to objects.

Member Enumeration Documentation

◆ Type

Enumerator
NONE 
STRING 
INT 
LONGINT 
DOUBLE 

Member Function Documentation

◆ AddMetadata() [1/5]

void nxcpp::MMetadata::AddMetadata ( const std::string &  strKey,
const std::string &  strValue 
)

Add std::string metadata

Parameters
strKeymetadata name
strValuemetadata value

◆ AddMetadata() [2/5]

void nxcpp::MMetadata::AddMetadata ( const std::string &  strKey,
const char *  pszValue 
)

Add C-ansi std::string metadata

Parameters
strKeymetadata name
pszValuemetadata value

◆ AddMetadata() [3/5]

void nxcpp::MMetadata::AddMetadata ( const std::string &  strKey,
int  iValue 
)

Add integer matedata

Parameters
strKeymetadata name
iValuemetadata value

◆ AddMetadata() [4/5]

void nxcpp::MMetadata::AddMetadata ( const std::string &  strKey,
long  lValue 
)

Add integer matedata

Parameters
strKeymetadata name
lValuemetadata value

◆ AddMetadata() [5/5]

void nxcpp::MMetadata::AddMetadata ( const std::string &  strKey,
double  dValue 
)

Add float metadata

Parameters
strKeymetadata name
dValuemetadata value

◆ ClearMetadata()

void nxcpp::MMetadata::ClearMetadata ( )

Clear all metadata.

◆ DoubleMetadata()

double nxcpp::MMetadata::DoubleMetadata ( const std::string &  strKey) const

Get long float (double-type) metadata

Parameters
strKeymetadata name
Returns
metadata value
Exceptions
Throwan exception if the key is not found

◆ GetDoubleMetadata()

bool nxcpp::MMetadata::GetDoubleMetadata ( const std::string &  strKey,
double *  pdValue,
bool  bThrow = true 
) const

Get long float (double-type) metadata

Parameters
strKeymetadata name
[out]pdValuepointer output value
bThrowif true throw a exception in case of no data
Returns
true if metadata was found, otherwise false (if bThrow == false)

◆ GetIntegerMetadata()

bool nxcpp::MMetadata::GetIntegerMetadata ( const std::string &  strKey,
int *  piValue,
bool  bThrow = true 
) const

Get integer metadata

Parameters
strKeymetadata name
[out]piValuepointer output value
bThrowif true throw a exception in case of no data
Returns
true if metadata was found, otherwise false (if bThrow == false)

◆ GetLongIntegerMetadata()

bool nxcpp::MMetadata::GetLongIntegerMetadata ( const std::string &  strKey,
long *  plValue,
bool  bThrow = true 
) const

Get long integer metadata

Parameters
strKeymetadata name
[out]plValuepointer output value
bThrowif true throw a exception in case of no data
Returns
true if metadata was found, otherwise false (if bThrow == false)

◆ GetMetadata()

bool nxcpp::MMetadata::GetMetadata ( const std::string &  strKey,
std::string *  pstrValue,
bool  bThrow = true 
) const

Get metadata as std::string Implicitely convert integer and float metadata as string value

Parameters
strKeymetadata name
[out]pstrValueValue as string
bThrowif true throw a exception in case of no data
Returns
true if metadata was found, otherwise false (if bThrow == false)

◆ GetMetadataType()

Type nxcpp::MMetadata::GetMetadataType ( const std::string &  strKey,
bool  bThrow = true 
) const

Get type of a metadata from its key name

Parameters
strKeymetadata name
bThrowif true throw a exception in case of no data
Returns
MMetadata::Type value

◆ GetStringMetadata()

bool nxcpp::MMetadata::GetStringMetadata ( const std::string &  strKey,
std::string *  pstrValue,
bool  bThrow = true 
) const

Get string metadata

Parameters
strKeymetadata name
[out]pstrValuepointer output value
bThrowif true throw a exception in case of no data
Returns
true if metadata was found, otherwise false (if bThrow == false)

◆ HasMetadata()

bool nxcpp::MMetadata::HasMetadata ( const std::string &  strKey) const

Check metadata

Parameters
strKeymetadata name

◆ IntegerMetadata()

int nxcpp::MMetadata::IntegerMetadata ( const std::string &  strKey) const

Get integer metadata

Parameters
strKeymetadata name
Returns
metadata value
Exceptions
Throwan exception if the key is not found

◆ LongIntegerMetadata()

long nxcpp::MMetadata::LongIntegerMetadata ( const std::string &  strKey) const

Get long integer metadata

Parameters
strKeymetadata name
Returns
metadata value
Exceptions
Throwan exception if the key is not found

◆ MetadataKeys()

std::list<std::string> nxcpp::MMetadata::MetadataKeys ( ) const

Returns the metadata keys std::list.

◆ StringMetadata()

std::string nxcpp::MMetadata::StringMetadata ( const std::string &  strKey) const

Get string metadata

Parameters
strKeymetadata name
Returns
metadata value
Exceptions
Throwan exception if the key is not found

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