Utility for NameValue. More...
Classes | |
struct | nv_find |
Functor to find a NVList. More... | |
class | NVUtilTests |
NVUtil Test. More... | |
struct | to_prop |
Functor to transform NVList into the properties. More... | |
Functions | |
void | append (SDOPackage::NVList &dest, const SDOPackage::NVList &src) |
Append an element to NVList. More... | |
bool | appendStringValue (SDOPackage::NVList &nv, const char *name, const char *value) |
Append the specified string to element of NVList. More... | |
void | copyFromProperties (SDOPackage::NVList &nv, const coil::Properties &prop) |
Copy the properties to NVList. More... | |
void | copyToProperties (coil::Properties &prop, const SDOPackage::NVList &nv) |
Copy NVList to the Proeprties. More... | |
void | dump (const SDOPackage::NVList &nv) |
Print information configured in NVList as a string type to Standard Outport. More... | |
std::ostream & | dump (std::ostream &out, const SDOPackage::NVList &nv) |
Print information configured in NVList as string type. More... | |
std::ostream & | dump_to_stream (std::ostream &out, const SDOPackage::NVList &nv) |
Print information configured in NVList as a string type. More... | |
const CORBA::Any & | find (const SDOPackage::NVList &nv, const char *name) |
Return the value specified by name from NVList. More... | |
const CORBA::Long | find_index (const SDOPackage::NVList &nv, const char *name) |
Return the index of element specified by name from NVList. More... | |
bool | isString (const SDOPackage::NVList &nv, const char *name) |
Validate whether value type specified by name is string type. More... | |
bool | isStringValue (const SDOPackage::NVList &nv, const char *name, const char *value) |
Check whether the value of specified name specified matches the specified string. More... | |
template<class Value > | |
SDOPackage::NameValue | newNV (const char *name, Value value) |
Create NameValue. More... | |
SDOPackage::NameValue | newNVAny (const char *name, const CORBA::Any &value) |
Create NameValue typed CORBA::Any. More... | |
SDOPackage::NameValue | newNVBool (const char *name, const CORBA::Boolean value) |
This operation creates NameValue typed CORBA::Boolean. More... | |
SDOPackage::NameValue | newNVChar (const char *name, const CORBA::Char value) |
Create NameValue typed CORBA::Char. More... | |
SDOPackage::NameValue | newNVOctet (const char *name, const CORBA::Octet value) |
Create NameValue typed CORBA::Octet. More... | |
coil::Properties | toProperties (const SDOPackage::NVList &nv) |
Transform NVList to the properties. More... | |
std::string | toString (const SDOPackage::NVList &nv, const char *name) |
Get NVList of specifid name as string. More... | |
std::string | toString (const SDOPackage::NVList &nv) |
Get information configured in NVList as a string type. More... | |
Variables | |
int | g_argc |
vector< string > | g_argv |
Utility for NameValue.
This class provides the utility function of NameValue.
void NVUtil::append | ( | SDOPackage::NVList & | dest, |
const SDOPackage::NVList & | src | ||
) |
Append an element to NVList.
This operation appends elements specified by src to NVList specified by dest.
dest | NVList to be appended |
src | NVList to append |
Definition at line 354 of file NVUtil.cpp.
bool NVUtil::appendStringValue | ( | SDOPackage::NVList & | nv, |
const char * | name, | ||
const char * | value | ||
) |
Append the specified string to element of NVList.
This operation appends the string value specified by value to the element specified by name. Operate nothing when the 'value' value has already been set to the element specified by name. Add the 'value' value each separating by a comma "," when the 'value' value is not set to the element specified by name. Set the specified value. Add a new element at the end of NVList, and set the specified value, when the element specified by name does not exist.
nv | The target NVList for the search |
name | The target element name for the appending |
value | String to append |
Definition at line 313 of file NVUtil.cpp.
void NVUtil::copyFromProperties | ( | SDOPackage::NVList & | nv, |
const coil::Properties & | prop | ||
) |
Copy the properties to NVList.
This operation copies the properties to NVList. All NVList's values are copied as CORBA::string.
nv | NVList to store properties values |
prop | Properties that is copies from |
Definition at line 108 of file NVUtil.cpp.
void NVUtil::copyToProperties | ( | coil::Properties & | prop, |
const SDOPackage::NVList & | nv | ||
) |
Copy NVList to the Proeprties.
This operation copies NVList to properties.
prop | Properties to store NVList values |
nv | NVList of copy source |
Definition at line 137 of file NVUtil.cpp.
void NVUtil::dump | ( | const SDOPackage::NVList & | nv | ) |
Print information configured in NVList as a string type to Standard Outport.
nv | The target NVList for the print |
Definition at line 394 of file NVUtil.cpp.
std::ostream& NVUtil::dump | ( | std::ostream & | out, |
const SDOPackage::NVList & | nv | ||
) |
Print information configured in NVList as string type.
Print configured information as string type in specified NVList. Also, print the reason (this is not string type) if the configured element is other than string type.
nv | The target NVList for the print |
std::ostream& NVUtil::dump_to_stream | ( | std::ostream & | out, |
const SDOPackage::NVList & | nv | ||
) |
Print information configured in NVList as a string type.
Definition at line 369 of file NVUtil.cpp.
const CORBA::Any & NVUtil::find | ( | const SDOPackage::NVList & | nv, |
const char * | name | ||
) |
Return the value specified by name from NVList.
This operation returns Any type of value specified by name. When an element of specified name doesn't exist, the exception will occur.
nv | The target NVList for the find |
name | Name for the find |
Definition at line 212 of file NVUtil.cpp.
const CORBA::Long NVUtil::find_index | ( | const SDOPackage::NVList & | nv, |
const char * | name | ||
) |
Return the index of element specified by name from NVList.
This operation returns the index at the position where the element specified by name is stored.
nv | The target NVList for the find |
name | Name for the find |
Definition at line 227 of file NVUtil.cpp.
bool NVUtil::isString | ( | const SDOPackage::NVList & | nv, |
const char * | name | ||
) |
Validate whether value type specified by name is string type.
This operation returns the bool value by checking whether the type of value specified with name is CORBA::string.
nv | The target NVList for the search |
name | Name for the search |
Definition at line 239 of file NVUtil.cpp.
bool NVUtil::isStringValue | ( | const SDOPackage::NVList & | nv, |
const char * | name, | ||
const char * | value | ||
) |
Check whether the value of specified name specified matches the specified string.
Check whether the value of specified name matches the specified string.
This operation checks whether the value specified with name is CORBA::string and returns the bool value which matches spcified string.
nv | The target NVList for the search |
name | Name for the search |
value | String value to compare |
Definition at line 262 of file NVUtil.cpp.
SDOPackage::NameValue NVUtil::newNV | ( | const char * | name, |
Value | value | ||
) |
Create NameValue.
This operation creates NameValue. CORBA::Char, CORBA::Boolean, CORBA::Octet creation is not supported. These type of NameValue should be created by using newNVChar(), newNVBool(), newNVOctet() functions.
name | Name of NameValue |
value | The value of NameValue |
SDOPackage::NameValue NVUtil::newNVAny | ( | const char * | name, |
const CORBA::Any & | value | ||
) |
Create NameValue typed CORBA::Any.
This operation creates NameValue typed CORBA::Any.
name | Name of NameValue |
value | The value of NameValue |
Definition at line 92 of file NVUtil.cpp.
SDOPackage::NameValue NVUtil::newNVBool | ( | const char * | name, |
const CORBA::Boolean | value | ||
) |
This operation creates NameValue typed CORBA::Boolean.
Create NameValue typed CORBA::Boolean.
This operation creates NameValue typed CORBA::Boolean.
name | Name of NameValue |
value | The value of NameValue |
Definition at line 62 of file NVUtil.cpp.
SDOPackage::NameValue NVUtil::newNVChar | ( | const char * | name, |
const CORBA::Char | value | ||
) |
Create NameValue typed CORBA::Char.
This operation creates NameValue typed CORBA::Char.
name | Name of NameValue |
value | The value of NameValue |
Definition at line 47 of file NVUtil.cpp.
SDOPackage::NameValue NVUtil::newNVOctet | ( | const char * | name, |
const CORBA::Octet | value | ||
) |
Create NameValue typed CORBA::Octet.
This operation creates NameValue typed CORBA::Octet.
name | Name of NameValue |
value | The value of NameValue |
Definition at line 77 of file NVUtil.cpp.
coil::Properties NVUtil::toProperties | ( | const SDOPackage::NVList & | nv | ) |
Transform NVList to the properties.
This operation transforms NVList to properties
nv | NVList of tranformation source |
Definition at line 180 of file NVUtil.cpp.
std::string NVUtil::toString | ( | const SDOPackage::NVList & | nv, |
const char * | name | ||
) |
Get NVList of specifid name as string.
This operation returns string value in NVList specified by name. If the value in NVList specified by name is not CORBA::string type this operation returns empty string value.
nv | The target NVList for the search |
name | Name for the search |
Definition at line 282 of file NVUtil.cpp.
std::string NVUtil::toString | ( | const SDOPackage::NVList & | nv | ) |
Get information configured in NVList as a string type.
nv | The target NVList for the print |
Definition at line 406 of file NVUtil.cpp.
int NVUtil::g_argc |
Definition at line 65 of file NVUtilTests.cpp.
vector<string> NVUtil::g_argv |
Definition at line 66 of file NVUtilTests.cpp.