DRAMA C++ Intro   Class Hierarchy   Alphabetical List of types   List of Classes   File List   Class Member Index   File Members Index   Related Pages  

GitTpl::String Class Reference

#include <gittpl.h>

List of all members.


Detailed Description

A class which reads a a string item from an SDS structure.

This class is based on std::string and hence all the normal operations are possible. We have attempted to provide all the normal std::string style contructors and assignment operators - 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 contructors.


Public Methods

 String ()
 Create an empty Git::String.

 String (const std::string &str)
 Create a Git::String from a std::string.

 String (const std::string &str, size_type pos, size_type n=std::string::npos)
 Create a Git::String from a std::string, initialised from s starting at index pos, maximum characters = n.

 String (const char *s)
 Create a Git::String from a C character array.

 String (const char *s, size_type n)
 Create a Git::String from the first n characters a C string.

 String (size_type n, char c)
 Create a Git::String intialised with n occurances of c.

template<class InputIterator>  String (InputIterator beg, InputIterator end)
 Create a Git::String that is initialised by all characters from beg to end.

 String (const SdsId &Id, const char *const Name, const int Position, StatusType *const status, const char *Default=0, const int Flags=Git::KeepErr)
 Constructor with the initial value set from an SDS structure.

String operator= (const std::string str)
 Assign str to this string.

String operator= (const String str)
 Assign str to this string.

String operator= (const char *s)
 Copy contents of s into this string.

String & operator= (char c)
 Set value to string of length 1.

void Get (const SdsId &Id, const char *const Name, const int Position, StatusType *const status, const char *Default=0, const int Flags=Git::KeepErr)
 Fetch the value of this item from an SDS structure.


Constructor & Destructor Documentation

GitTpl::String::String   [inline]
 

Create an empty Git::String.

GitTpl::String::String const std::string &    str [inline]
 

Create a Git::String from a std::string.

Parameters:
str  Source string.

GitTpl::String::String const std::string &    str,
size_type    pos,
size_type    n = std::string::npos
[inline]
 

Create a Git::String from a std::string, initialised from s starting at index pos, maximum characters = n.

Parameters:
str  Source string.
pos  Index of first character to copy from.
n  Number of characters to copy (default remainder).

GitTpl::String::String const char *    s [inline]
 

Create a Git::String from a C character array.

Parameters:
s  Source C string.

GitTpl::String::String const char *    s,
size_type    n
[inline]
 

Create a Git::String from the first n characters a C string.

Parameters:
s  Character to use.
n  Number of characters.

GitTpl::String::String size_type    n,
char    c
[inline]
 

Create a Git::String intialised with n occurances of c.

template<class InputIterator>
GitTpl::String::String InputIterator    beg,
InputIterator    end
[inline]
 

Create a Git::String that is initialised by all characters from beg to end.

Parameters:
beg  Start of range.
end  End of range.

GitTpl::String::String const SdsId   Id,
const char *const    Name,
const int    Position,
StatusType *const    status,
const char *    Default = 0,
const int    Flags = Git::KeepErr
[inline]
 

Constructor with the initial value set from an SDS structure.

Parameters:
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.
status  Inherited status
Default  The default value. If not specified, a null string is used.
Flags  Which GIT Flags to apply. If not specified, uses Git::KeepErr.


Member Function Documentation

void GitTpl::String::Get const SdsId   Id,
const char *const    Name,
const int    Position,
StatusType *const    status,
const char *    Default = 0,
const int    Flags = Git::KeepErr
 

Fetch the value of this item from an SDS structure.

Parameters:
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.
status  Inherited status
Default  The default value. If not specified, a null string is used.
Flags  Which GIT Flags to apply. If not specified, uses Git::KeepErr.

String& GitTpl::String::operator= char    c [inline]
 

Set value to string of length 1.

Parameters:
c  Source character.
Assigning to a character makes this string length 1 and (*this)[0] == c.

String GitTpl::String::operator= const char *    s [inline]
 

Copy contents of s into this string.

Parameters:
s  Source null-terminated string.

String GitTpl::String::operator= const String    str [inline]
 

Assign str to this string.

Parameters:
str  Source null-terminated string.

String GitTpl::String::operator= const std::string    str [inline]
 

Assign str to this string.

Parameters:
str  Source null-terminated string.


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

Click here for the DRAMA home page and here for the AAO home page.

For more information, contact tjf@aaoepp.aao.gov.au 

Generated on Tue Nov 3 09:09:56 2009 for AAO DRAMA C++ Interfaces by doxygen 1.2.18