#include <secstwo_internal.hpp>
Public Types | |
typedef type_selector< _type > ::data_type | data_t |
typedef type_selector< _type > ::print_type | print_t |
typedef type_selector< _type > ::container_type | container_t |
Public Member Functions | |
string_data_item_t (const char *name) | |
string_data_item_t (const char *name, uint8_t *data) | |
string_data_item_t (const char *name, uint8_t *data, size_t data_len) | |
string_data_item_t (const char *name, const wchar_t *data) | |
virtual data_type_t | type () const |
Returns data item type. | |
virtual | operator std::string () const |
String type cast operator. Casts a data item to the given primary type. Any numeric data item can be casted to any numeric type. String data items and list data items return 0 (zero) if to attempt to cast to a numeric type Numeric and list types return an empty string if to attempt to cast to a string. | |
virtual data_item_t & | operator= (const char *data) |
String type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value. | |
virtual data_item_t & | operator= (const std::string &data) |
String type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value. | |
virtual data_item_t & | operator+= (const char *data) |
virtual data_item_t & | operator+= (const std::string &data) |
virtual bool | operator== (const std::string &o) const |
String comparison operator. | |
virtual bool | match (const data_item_t &other, match_t match=ALL) const |
Function to match a given data item to another data item. | |
virtual pdata_item_t | clone () const |
Creates a copy of the message. Calls data item copy constructor and puts newly returned data item into a shared ptr. Contrary to cloning shared ptrs with ref count on a message is incremented, cloned message is a separate one and it's data can be edited with no impact to the nacestor data item. | |
virtual void | clear_data () |
Clears all data in a data item. | |
virtual int | copy_data (const data_item_t &o) |
Copies all data from the given item. Data copy is made if data items have same type. For list item copy data is made reqursively and does not stop upon unsuccesful data copy. | |
virtual size_t | size () const |
Returns number of elements. | |
virtual size_t | raw_size () const |
Returns number of bytes the item occupies in binary format. | |
virtual void | print (std::ostream &os, const char *prefix=NULL) const |
Prints the item in human-readable format. | |
Public Attributes | |
container_t | _data |
Definition at line 848 of file secstwo_internal.hpp.
virtual data_type_t freesecs::secstwo::string_data_item_t< _type >::type | ( | ) | const [inline, virtual] |
Returns data item type.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 904 of file secstwo_internal.hpp.
virtual data_item_t& freesecs::secstwo::string_data_item_t< _type >::operator= | ( | const char * | ) | [inline, virtual] |
String type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 912 of file secstwo_internal.hpp.
virtual data_item_t& freesecs::secstwo::string_data_item_t< _type >::operator= | ( | const std::string & | ) | [inline, virtual] |
String type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 918 of file secstwo_internal.hpp.
virtual bool freesecs::secstwo::string_data_item_t< _type >::operator== | ( | const std::string & | ) | const [inline, virtual] |
String comparison operator.
true | Comparison successful | |
false | Comparison unsuccessful - either data or structure (for lists) or type do not match |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 934 of file secstwo_internal.hpp.
virtual bool freesecs::secstwo::string_data_item_t< _type >::match | ( | const data_item_t & | it, | |
match_t | match = ALL | |||
) | const [inline, virtual] |
Function to match a given data item to another data item.
it | Item to match. | |
match | Token of kind of match. |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 939 of file secstwo_internal.hpp.
References freesecs::secstwo::string_data_item_t< _type >::_data, and freesecs::secstwo::data_item_t::type().
virtual int freesecs::secstwo::string_data_item_t< _type >::copy_data | ( | const data_item_t & | ) | [inline, virtual] |
Copies all data from the given item. Data copy is made if data items have same type. For list item copy data is made reqursively and does not stop upon unsuccesful data copy.
0 | Data copy successful | |
< | 0 Data copy performed with errors |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 971 of file secstwo_internal.hpp.
References freesecs::secstwo::string_data_item_t< _type >::_data, and freesecs::secstwo::data_item_t::type().