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

xtl_text_container_impl Class Template Reference

#include <xtl_container_impl.h>

Inheritance diagram for xtl_text_container_impl:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<typename StringT = CTTL_STD_STRING>
class cttl_impl::xtl_text_container_impl< StringT >

defines core functionality of the CTTL text container class.

StringT
Template parameter specifying type of the encapsulated string. The default is std::string

Definition at line 58 of file xtl_container_impl.h.

Protected Types

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

Protected Member Functions

 xtl_text_container_impl (size_t vector_size_)
 Constructs xtl_text_container_impl and sets initial identity vector size.
 xtl_text_container_impl (char_T const *pchar_, size_t vector_size_)
 Constructs xtl_text_container_impl, sets user text and initial identity vector size.
 xtl_text_container_impl (StringT const &str_, size_t vector_size_)
 Constructs xtl_text_container_impl, sets user text and initial identity vector size.
void identity_zero_all ()
 Sets positions of all identities to zero offset.
size_t line_2_offset (int line_) const
 Converts line number to offset.
size_t offset_2_line (size_t offset_) const
 Converts specified offset_ to the line number.
size_t offset_2_next_line_offset (size_t offset_) const
 Converts specified offset_ to the offset of the next line home offset.
size_t offset_2_line_home_offset (size_t offset_) const
 Converts specified offset_ to the offset of the current line home offset.
size_t offset_2_line_end_offset (size_t offset_) const
 Converts specified offset_ to the offset of the current line end offset.

Protected Attributes

StringT m_client_str
 Stores string containing user input.
std::vector< size_t > m_offset_stack
 Stores general purpose offset stack.
std::vector< size_t > m_identity_vector
 Stores vector of offset identities.


Constructor & Destructor Documentation

xtl_text_container_impl size_t  vector_size_  )  [inline, explicit, protected]
 

Constructs xtl_text_container_impl and sets initial identity vector size.

See also:

Definition at line 85 of file xtl_container_impl.h.


Member Function Documentation

size_t line_2_offset int  line_  )  const [inline, protected]
 

Converts line number to offset.

Parameters:
line_ Source line number to be converted to the offset
Returns:
Offset corresponding to the beginning of the source line.
Postcondition:
If specified source line number is too big (there is no such line) then the returned offset is length of the encapsulated string, xtl_text_container_impl::m_client_str.

Definition at line 146 of file xtl_container_impl.h.

size_t offset_2_line size_t  offset_  )  const [inline, protected]
 

Converts specified offset_ to the line number.

Complexity
linear. Exactly last - first comparisons.

Definition at line 164 of file xtl_container_impl.h.

size_t offset_2_line_end_offset size_t  offset_  )  const [inline, protected]
 

Converts specified offset_ to the offset of the current line end offset.

Complexity: linear. The following diagram demonstrates how line numbers are calculated:

        one\r\ntwo
        111----222-
        B  E   B  E

Definition at line 220 of file xtl_container_impl.h.

size_t offset_2_line_home_offset size_t  offset_  )  const [inline, protected]
 

Converts specified offset_ to the offset of the current line home offset.

Complexity
linear. The following diagram demonstrates how line numbers are calculated:
        one\r\ntwo
        111----222-
        B  E   B  E

Definition at line 197 of file xtl_container_impl.h.

size_t offset_2_next_line_offset size_t  offset_  )  const [inline, protected]
 

Converts specified offset_ to the offset of the next line home offset.

Complexity
linear.

Definition at line 177 of file xtl_container_impl.h.


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