Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

input Class Template Reference

#include <input.h>

List of all members.


Detailed Description

template<typename StringT = CTTL_STD_STRING>
class cttl::input< StringT >

Template class cttl::input accommodates user input text and maintains offset identity vector.

StringT
Template parameter specifying type of the encapsulated string. The default is std::string
Remarks:
The input object delegates most of its functionality to the text container implementation class, cttl_impl::xtl_text_container.
See also:

Definition at line 64 of file input.h.

Public Types

typedef StringT string_T
 Defines type of encapsulated string.
typedef string_T::value_type char_T
 Defines type of encapsulated character.

Public Member Functions

 input (size_t vector_size_=xtl_identity_vector_default_size)
 Default constructor.
 input (char_T const *pchar_, size_t vector_size_=xtl_identity_vector_default_size)
 Constructs new object and stores null-terminated input string.
 input (char_T *array_[], char_T delimiter_=char_T( '\n'), size_t vector_size_=xtl_identity_vector_default_size)
 Constructs new object and stores user input specified by array of string literals.
 input (string_T const &str_, size_t vector_size_=xtl_identity_vector_default_size)
 Constructs new object and stores user input specified by a string.
 ~input ()
 Desctructs and frees up resources occupied by the objects.
xtl_text_container< StringT > & container ()
 Returns mutable reference to the encapsulated cttl_impl::xtl_text_container object.
xtl_text_container< StringT
> const & 
container () const
 Returns constant reference to the encapsulated cttl_impl::xtl_text_container object.
size_t vector_size (size_t new_size_)
 Resizes offset identity vector.
size_t vector_size ()
 Returns current size of the offset identity vector.
void text (char_T const *pchar_)
 Sets user input text.
void text (string_T const &str_)
 Sets user input text.
string_T const & text () const
 Returns const reference to user input text.
string_Ttext ()
 Returns mutable reference to user input text.
size_t length () const
 Returns length of the user input text.


Constructor & Destructor Documentation

input size_t  vector_size_ = xtl_identity_vector_default_size  )  [inline]
 

Default constructor.

Parameters:
vector_size_ Optional parameter specifying initial size of the identity vector.

Definition at line 89 of file input.h.

References cttl_impl::xtl_flag_default.

input char_T const *  pchar_,
size_t  vector_size_ = xtl_identity_vector_default_size
[inline]
 

Constructs new object and stores null-terminated input string.

Parameters:
pchar_ NULL terminated source string.
vector_size_ Optional parameter specifying initial size of the identity vector.

Definition at line 105 of file input.h.

References cttl_impl::xtl_flag_default.

input char_T array_[],
char_T  delimiter_ = char_T( '\n' ),
size_t  vector_size_ = xtl_identity_vector_default_size
[inline]
 

Constructs new object and stores user input specified by array of string literals.

Parameters:
array_ Source array of string literals.
delimiter_ A single-character delimiter to be inserted between source text fragments.
vector_size_ Optional parameter specifying initial size of the identity vector.
Precondition:
Array should have trailing NULL string, for example,
char* arr[] = { "abc", "def", NULL };

Definition at line 131 of file input.h.

References cttl::string_array2string(), xtl_text_container::text(), and cttl_impl::xtl_flag_default.

input string_T const &  str_,
size_t  vector_size_ = xtl_identity_vector_default_size
[inline]
 

Constructs new object and stores user input specified by a string.

Parameters:
str_ reference to the source string.
vector_size_ Optional parameter specifying initial size of the identity vector.

Definition at line 152 of file input.h.

References cttl_impl::xtl_flag_default.


Member Function Documentation

size_t vector_size size_t  new_size_  )  [inline]
 

Resizes offset identity vector.

Parameters:
new_size_ New identity vector size.
Returns:
New identity vector size.
Postcondition:
Forces new size of the offset identity vector. Can either expand or shorten current size of the vector.

Definition at line 207 of file input.h.

References xtl_text_container::identity_vector_size().


The documentation for this class was generated from the following file:
Generated on Thu Nov 2 17:45:01 2006 for Common Text Transformation Library by  doxygen 1.3.9.1