C++ bindings for cgul_convspec
More...
#include <cgul_convspec_cxx.h>
This class provides the C++ bindings for C cgul_convspec
objects. The main purpose of this class is to convert the C-style function calls and exception handling in cgul_convspec
into C++-style function calls and exception handling.
- See also
- cgul_convspec_t
§ cgul_convspec_cxx() [1/3]
cgul_convspec_cxx::cgul_convspec_cxx |
( |
| ) |
|
|
inline |
§ cgul_convspec_cxx() [2/3]
§ cgul_convspec_cxx() [3/3]
§ ~cgul_convspec_cxx()
virtual cgul_convspec_cxx::~cgul_convspec_cxx |
( |
| ) |
|
|
inlinevirtual |
This method deletes the object by freeing all internally allocated resources associated with the object. The caller must not use the object after calling this method.
References cgul_convspec__delete().
§ operator=() [1/2]
§ operator=() [2/2]
§ copy()
§ deserialize()
virtual void cgul_convspec_cxx::deserialize |
( |
const char * |
format, |
|
|
unsigned long int * |
index |
|
) |
| |
|
inlinevirtual |
This method assumes the conversion specification begins with a '' character at format[index]
and increments index
for each character that is consumed such that when this method returns index
points to one character beyond the end of the conversion specification. This is the primary method to use when you want to initialize an instance of this class.
Note that serializing an object of this class produces a conversion specification string that is suitable for use as part of a format string that can be passed to printf()
. Thus, deserializing an instance of this class reduces a printf()
conversion specification into its component parts.
If an error occurs, an exception is thrown, and the object will be in an undefined state.
It is important that you call this method correctly. Because index
is a pointer to a variable, you must define and use a variable:
unsigned long int index = 0;
cs.deserialize("%d", &index);
- Parameters
-
[in] | format | format string |
[in,out] | index | index into format |
References cgul_convspec__deserialize().
§ serialize()
This method serializes the object to a string and appends the result to s
. Note that serializing an object of this class produces a conversion specification string that is suitable for use as part of a format string that can be passed to printf()
.
If an error occurs, an exception is thrown. An error can occur if the system runs out of memory while inserting into s
. In this case, s
will be in an undefined state.
- Parameters
-
References cgul_convspec__serialize(), and cgul_string_cxx::get_obj().
§ get_flag_hash()
virtual int cgul_convspec_cxx::get_flag_hash |
( |
| ) |
const |
|
inlinevirtual |
§ set_flag_hash()
virtual void cgul_convspec_cxx::set_flag_hash |
( |
int |
flag_hash | ) |
|
|
inlinevirtual |
§ get_flag_zero()
virtual int cgul_convspec_cxx::get_flag_zero |
( |
| ) |
const |
|
inlinevirtual |
§ set_flag_zero()
virtual void cgul_convspec_cxx::set_flag_zero |
( |
int |
flag_zero | ) |
|
|
inlinevirtual |
§ get_flag_dash()
virtual int cgul_convspec_cxx::get_flag_dash |
( |
| ) |
const |
|
inlinevirtual |
§ set_flag_dash()
virtual void cgul_convspec_cxx::set_flag_dash |
( |
int |
flag_dash | ) |
|
|
inlinevirtual |
§ get_flag_space()
virtual int cgul_convspec_cxx::get_flag_space |
( |
| ) |
const |
|
inlinevirtual |
§ set_flag_space()
virtual void cgul_convspec_cxx::set_flag_space |
( |
int |
flag_space | ) |
|
|
inlinevirtual |
§ get_flag_plus()
virtual int cgul_convspec_cxx::get_flag_plus |
( |
| ) |
const |
|
inlinevirtual |
§ set_flag_plus()
virtual void cgul_convspec_cxx::set_flag_plus |
( |
int |
flag_plus | ) |
|
|
inlinevirtual |
§ get_is_field_width_present()
virtual int cgul_convspec_cxx::get_is_field_width_present |
( |
| ) |
const |
|
inlinevirtual |
§ set_is_field_width_present()
virtual void cgul_convspec_cxx::set_is_field_width_present |
( |
int |
is_field_width_present | ) |
|
|
inlinevirtual |
§ get_is_field_width_on_stack()
virtual int cgul_convspec_cxx::get_is_field_width_on_stack |
( |
| ) |
const |
|
inlinevirtual |
§ set_is_field_width_on_stack()
virtual void cgul_convspec_cxx::set_is_field_width_on_stack |
( |
int |
is_field_width_on_stack | ) |
|
|
inlinevirtual |
Set whether the field width is on the stack. This occurs when the conversion specifier uses '*' instead of an actual width. Calling this method with is_field_width_on_stack
set to true
does not implicitly mark the field width as present. You will still need to call set_is_field_width_present()
if that is the intent.
- Parameters
-
[in] | is_field_width_on_stack | whether the field width is on stack |
References cgul_convspec__set_is_field_width_on_stack().
§ get_field_width()
virtual int cgul_convspec_cxx::get_field_width |
( |
| ) |
const |
|
inlinevirtual |
§ set_field_width()
virtual void cgul_convspec_cxx::set_field_width |
( |
int |
field_width | ) |
|
|
inlinevirtual |
§ get_is_precision_present()
virtual int cgul_convspec_cxx::get_is_precision_present |
( |
| ) |
const |
|
inlinevirtual |
§ set_is_precision_present()
virtual void cgul_convspec_cxx::set_is_precision_present |
( |
int |
is_precision_present | ) |
|
|
inlinevirtual |
§ get_is_precision_on_stack()
virtual int cgul_convspec_cxx::get_is_precision_on_stack |
( |
| ) |
const |
|
inlinevirtual |
§ set_is_precision_on_stack()
virtual void cgul_convspec_cxx::set_is_precision_on_stack |
( |
int |
is_precision_on_stack | ) |
|
|
inlinevirtual |
Set whether the precision is on the stack. This occurs when the conversion specifier uses '*' instead of an actual precision. Calling this method with is_precision_on_stack
set to true
does not implicitly mark the precision as present. You will still need to call set_is_precision_present()
if that is the intent.
- Parameters
-
[in] | is_precision_on_stack | whether the precision is on stack |
References cgul_convspec__set_is_precision_on_stack().
§ get_precision()
virtual int cgul_convspec_cxx::get_precision |
( |
| ) |
const |
|
inlinevirtual |
§ set_precision()
virtual void cgul_convspec_cxx::set_precision |
( |
int |
precision | ) |
|
|
inlinevirtual |
§ get_is_length_modifier_present()
virtual int cgul_convspec_cxx::get_is_length_modifier_present |
( |
| ) |
const |
|
inlinevirtual |
§ set_is_length_modifier_present()
virtual void cgul_convspec_cxx::set_is_length_modifier_present |
( |
int |
is_length_modifier_present | ) |
|
|
inlinevirtual |
§ get_length_modifier()
virtual const char* cgul_convspec_cxx::get_length_modifier |
( |
| ) |
const |
|
inlinevirtual |
§ set_length_modifier()
virtual void cgul_convspec_cxx::set_length_modifier |
( |
const char * |
length_modifier | ) |
|
|
inlinevirtual |
§ get_cspec()
virtual char cgul_convspec_cxx::get_cspec |
( |
| ) |
const |
|
inlinevirtual |
Get the conversion specifier. For example, this is the 'd' character in the "%d" conversion specification.
- Returns
- conversion specifier
References cgul_convspec__get_cspec().
§ set_cspec()
virtual void cgul_convspec_cxx::set_cspec |
( |
char |
cspec | ) |
|
|
inlinevirtual |
Set the conversion specifier. For example, this is the 'd' character in the "%d" conversion specification.
- Parameters
-
[in] | cspec | conversion specifier |
References cgul_convspec__set_cspec().
§ get_obj()
Get the underlying cgul_convspec
object.
- Returns
- underlying object
§ take_obj()
Take the underlying cgul_convspec
object. This means the underlying object will not be deleted when the wrapper goes out of scope. Also, because you have taken the underlying object, no other methods should be called on this wrapper's instance. Lastly, after taking the underlying object, it is the caller's responsibility to delete the underlying object by calling cgul_convspec__delete()
.
- Returns
- underlying object
§ set_obj()
Set the new underlying object to rhs
. This causes the old underlying object to be deleted which invalidates any outstanding pointers to or iterators for the old underlying object.
This instance takes ownership of rhs
which means rhs
will be automatically deleted when the C++ wrapper is deleted. To prevent automatic deletion of rhs
, call take_obj()
when the C++ wrapper is no longer needed.
- Parameters
-
References cgul_convspec__delete().
The documentation for this class was generated from the following file: