Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

CTextStrs Class Reference

Managing list of strings. More...

#include <textstrs.h>

List of all members.

Public Member Functions

void SetIdent (bool b=true)
 Sets ident for the wrapped section of the added text.

void EraseTop (unsigned int pos)
void Erase (unsigned int pos, unsigned int where, unsigned int len)
 Erases symbols in the string Erases "len" number of characters starting at position "where" from the line "pos".

void Insert (unsigned int pos, unsigned int where, std::string &str)
 Inserts substring.

unsigned int LenAt (unsigned int pos)
 Length of the line number "pos".

void clear ()
 Erase all strings.

unsigned int size ()
 Number of strings.

const std::string & operator[] (unsigned int i) const
 Get line number "i".

void SetWrap (bool b)
 Enables wrapping for newly added lines.

bool IsWrap ()
 Is wrapping enabled?.

unsigned int GetCharOnDisp ()
 Returns number of set characters for displaying.

void SetCharOnDisp (unsigned int ui)
 Sets maximum number of characters for wrapping.

unsigned int GetMaxDis ()
 Returns the length of the longest line.

void push_back (std::string str)
 Add a new line.


Detailed Description

Managing list of strings.

This class stores list of strings. The main goal of this class is wrapping the line, when it is added. Without this task just a vector could suffice. This class is not inside of the sjgui, because it is a general class, which will be used if you want to interact with the gui, but do not want to know anything about it.

/par During wrapping, strings are cut on following symbols if possible: ,/.|?-#^*)$;]\! and space. If string with "end of line" characters is given, it is cut onto lines. Tab is substituted by 4 spaces. All characters with ASCII code not within 32 to 127 range are replaced with space characters.

Author:
Alexander Shyrokov
Version:
Revision
1.1.1.1


Member Function Documentation

void CTextStrs::Erase unsigned int  pos,
unsigned int  where,
unsigned int  len
[inline]
 

Erases symbols in the string Erases "len" number of characters starting at position "where" from the line "pos".

void CTextStrs::EraseTop unsigned int  pos  )  [inline]
 

Parameters:
pos  Erases pos top lines.

unsigned int CTextStrs::GetCharOnDisp  )  [inline]
 

Returns number of set characters for displaying.

This is used in wrapping when a new line is added.

unsigned int CTextStrs::GetMaxDis  )  [inline]
 

Returns the length of the longest line.

void CTextStrs::Insert unsigned int  pos,
unsigned int  where,
std::string &  str
[inline]
 

Inserts substring.

Inserts substring at position "where" at line "pos".

void CTextStrs::push_back std::string  str  )  [inline]
 

Add a new line.

Wraps the string if wrapping is enabled and is required, i.e. the length of the string is longer then GetCharOnDisp(), "ident" number off spaces is added to each wrapped line. The value of "ident" is set by SetIdent().

See also:
GetCharOnDisp, see SetIdent

void CTextStrs::SetCharOnDisp unsigned int  ui  )  [inline]
 

Sets maximum number of characters for wrapping.

This is used in wrapping when a new line is added.


The documentation for this class was generated from the following file:
sjgui logo
Quick Links:

 News
 Description
 Screen Shots
 Projects
 Downloads
 Source Code
 Help/FAQ
 Want to help?
 Credits
 Disclaimer


Documentation:

 Documentation
 Reference
 Lessons


Useful links:

sjcomp logo
sjcomp

opengl logo

nehe logo

SourceForge.net Logo

Last modified:


Started by Alexander Shyrokov. Generated at Wed Apr 28 12:31:05 2004 for the sjgui by doxygen 1.3.1. SourceForge.net Logo