AAO DRAMA/DRAMA2 C++ Interface
|
A class which reads a string item from an SDS structure.
This class is a subclass of std::string and hence all the normal string operations are possible. All std::string constructors are inherited. The std::string assignment operators are re-implemented.
This combination which should mean that this class could be used where-ever a std::string is used, but would provide the Get() function to get the value from an SDS structure, as well as a similar style constructor.
#include "gitarg.hh"
Public Member Functions | |
String (const sds::Id &Id, const std::string &Name="Argument1", const int Position=1, const std::string &Default="", const Flags flags=Flags::KeepErr) | |
Constructor with the initial value set from an SDS structure. More... | |
virtual void | Get (const sds::Id &Id, const std::string &Name="Argument1", const int Position=1, const std::string &Default="", const Flags flags=Flags::KeepErr) |
Fetch the value of this item from an SDS structure. More... | |
String | operator= (const std::string str) |
Assign a std::string to this gitarg::String. More... | |
String | operator= (const String str) |
Assign a const std::string to this gitarg::String. More... | |
String | operator= (const char *s) |
Copy contents of a C string into this gitarg::String. More... | |
String & | operator= (char c) |
Set this gitarg::String to a string containing a single character. More... | |
|
inline |
Constructor with the initial value set from an SDS structure.
The value is fetched from the named item (arg #2) within the SDS structure specified. or the Position (constructor arg #3) item in the structure if the item named does not exist.
Id | The SDS structure. |
Name | The name of the item within the structure. |
Position | If the item does not exist by the name, then presume this position. |
Default | The default value. If not specified, an empty string is used. |
flags | Which GIT Flags to apply. If you specify KeepErr, then an exception is throw if the value in the SDS structure is invalid. If you don't specify KeepErr and and the SDS structure does not contain a value item, then the value is set to the supplied default. |
References Get().
|
virtual |
Fetch the value of this item from an SDS structure.
The value is fetched from the named item (arg #2) within the SDS structure specified. or the Position (constructor arg #3) item in the structure if the item named does not exist.
Id | The SDS structure. |
Name | The name of the item within the structure. |
Position | If the item does not exist by the name, then presume this position. |
Default | The default value. |
flags | Which GIT Flags to apply. If you specify KeepErr, then an exception is throw if the value in the SDS structure is invalid. If you don't specify KeepErr and and the SDS structure does not contain a value item, then the value is set to the supplied default. |
Referenced by String().
|
inline |
Assign a std::string to this gitarg::String.
str | Source string. |
Assign a const std::string to this gitarg::String.
str | Source string. |
|
inline |
Copy contents of a C string into this gitarg::String.
s | Source C style null-terminated string. |
|
inline |
Set this gitarg::String to a string containing a single character.
c | Source character. |
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tjf@aao.gov.au Generated on Mon Feb 22 2016 15:57:53 for AAO DRAMA/DRAMA2 C++ Interface by