Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | List of all members
editline Struct Reference

#include <textedit.hpp>

Public Types

enum  { CHUNKSIZE = 256 }
 

Public Member Functions

 editline ()
 
 editline (const char *init)
 
bool empty ()
 
void clear ()
 
bool grow (int total, const char *fmt=nullptr,...) PRINTFARGS(3
 
 if (fmt)
 
 DELETEA (text)
 
void set (const char *str, int slen=-1)
 
void prepend (const char *str)
 
void append (const char *str)
 
bool read (stream *f, int chop=-1)
 
void del (int start, int count)
 
void chop (int newlen)
 
void insert (char *str, int start, int count=0)
 
void combinelines (vector< editline > &src)
 

Public Attributes

char * text
 
int len
 
int maxlen
 
bool maxlen = (total + CHUNKSIZE) - total%CHUNKSIZE
 
char * newtext = new char[maxlen]
 
else newtext [0] = '\0'
 
 text = newtext
 
return true
 

Member Enumeration Documentation

anonymous enum
Enumerator
CHUNKSIZE 

Constructor & Destructor Documentation

editline::editline ( )
inline
editline::editline ( const char *  init)
inline

References set().

Member Function Documentation

void editline::append ( const char *  str)
inline

References grow(), len, and text.

Referenced by combinelines(), editor::del(), and editor::key().

void editline::chop ( int  newlen)
inline

References len, and text.

Referenced by editor::insert(), and read().

void editline::clear ( )
inline

References DELETEA(), len, maxlen, and text.

Referenced by editor::load().

void editline::combinelines ( vector< editline > &  src)
inline
void editline::del ( int  start,
int  count 
)
inline

References len, recorder::start(), and text.

Referenced by editor::key().

editline::DELETEA ( text  )

Referenced by clear().

bool editline::empty ( )
inline

References len.

bool editline::grow ( int  total,
const char *  fmt = nullptr,
  ... 
)

Referenced by append(), insert(), prepend(), read(), and set().

editline::if ( fmt  )
inline
void editline::insert ( char *  str,
int  start,
int  count = 0 
)
inline

References grow(), len, and text.

Referenced by combinelines(), editor::insert(), and editor::insertallfrom().

void editline::prepend ( const char *  str)
inline

References grow(), len, and text.

bool editline::read ( stream f,
int  chop = -1 
)
inline
void editline::set ( const char *  str,
int  slen = -1 
)
inline

Member Data Documentation

int editline::len
int editline::maxlen

Referenced by clear(), if(), and read().

bool editline::maxlen = (total + CHUNKSIZE) - total%CHUNKSIZE
char* editline::newtext = new char[maxlen]
else editline::newtext[0] = '\0'
char* editline::text
editline::text = newtext
return editline::true

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