obby::text::chunk Class Reference

Single text chunk. More...

#include <text.hpp>

List of all members.

Public Member Functions

 chunk (const chunk &other)
 chunk (const string_type &string, const user *author)
 chunk (const net6::packet &pack, unsigned int &index, const user_table &table)
 Reads a chunk from a net6::packet.
 chunk (const serialise::object &obj, const user_table &table)
 Reads a chunk from a serialisation object.
void serialise (serialise::object &obj) const
 Serialises the chunk to the given serialisation object.
void append_packet (net6::packet &pack) const
 Reads the chunk from a net6::packet.
void prepend (const string_type &text)
 Prepends text to the chunk.
void append (const string_type &text)
 Appends text to the chunk.
void insert (size_type pos, const string_type &text)
 Inserts text into the chunk.
void erase (size_type pos, size_type len=npos)
 Erases text from the chunk.
const string_typeget_text () const
 Returns the chunk's text.
size_type get_length () const
 Returns the length of this chunk.
const userget_author () const
 Returns the user that has written this chunk.

Protected Attributes

string_type m_text
const userm_author


Detailed Description

Single text chunk.

Definition at line 67 of file text.hpp.


Constructor & Destructor Documentation

obby::text::chunk::chunk ( const chunk other  ) 

Definition at line 53 of file text.cpp.

obby::text::chunk::chunk ( const string_type string,
const user author 
)

Definition at line 58 of file text.cpp.

obby::text::chunk::chunk ( const net6::packet &  pack,
unsigned int &  index,
const user_table table 
)

Reads a chunk from a net6::packet.

The user table is used to lookup user IDs.

Definition at line 65 of file text.cpp.

obby::text::chunk::chunk ( const serialise::object obj,
const user_table table 
)

Reads a chunk from a serialisation object.

The user table is used to lookup user IDs.

Definition at line 78 of file text.cpp.


Member Function Documentation

void obby::text::chunk::serialise ( serialise::object obj  )  const

Serialises the chunk to the given serialisation object.

Definition at line 89 of file text.cpp.

References obby::serialise::object::add_attribute(), m_author, and m_text.

void obby::text::chunk::append_packet ( net6::packet &  pack  )  const

Reads the chunk from a net6::packet.

Definition at line 95 of file text.cpp.

References m_author, and m_text.

void obby::text::chunk::prepend ( const string_type text  ) 

Prepends text to the chunk.

Definition at line 100 of file text.cpp.

References m_text.

Referenced by obby::text::erase_chunk(), obby::text::insert_chunk(), obby::text::prepend(), and obby::text::set_max_chunk_size().

void obby::text::chunk::append ( const string_type text  ) 

Appends text to the chunk.

Definition at line 105 of file text.cpp.

References m_text.

Referenced by obby::text::append(), obby::text::erase_chunk(), obby::text::insert_chunk(), and obby::text::substr().

void obby::text::chunk::insert ( size_type  pos,
const string_type text 
)

Inserts text into the chunk.

Definition at line 110 of file text.cpp.

References m_text.

Referenced by obby::text::insert_chunk().

void obby::text::chunk::erase ( size_type  pos,
size_type  len = npos 
)

Erases text from the chunk.

Definition at line 115 of file text.cpp.

References m_text.

Referenced by obby::text::erase_chunk(), and obby::text::insert_chunk().

const obby::text::string_type & obby::text::chunk::get_text (  )  const

Returns the chunk's text.

Definition at line 120 of file text.cpp.

References m_text.

Referenced by obby::text::erase_chunk(), obby::text::insert_chunk(), obby::text::set_max_chunk_size(), and obby::text::substr().

obby::text::size_type obby::text::chunk::get_length (  )  const

Returns the length of this chunk.

Equivalent to get_text().length()

Definition at line 130 of file text.cpp.

References m_text.

Referenced by obby::text::append(), obby::text::erase_chunk(), obby::text::insert_chunk(), obby::text::prepend(), obby::text::set_max_chunk_size(), and obby::text::substr().

const obby::user * obby::text::chunk::get_author (  )  const

Returns the user that has written this chunk.

Definition at line 125 of file text.cpp.

References m_author.

Referenced by obby::text::append(), obby::text::erase_chunk(), obby::text::insert_chunk(), obby::text::prepend(), obby::text::set_max_chunk_size(), and obby::text::substr().


Member Data Documentation

string_type obby::text::chunk::m_text [protected]

Definition at line 128 of file text.hpp.

Referenced by append(), append_packet(), erase(), get_length(), get_text(), insert(), prepend(), and serialise().

const user* obby::text::chunk::m_author [protected]

Definition at line 129 of file text.hpp.

Referenced by append_packet(), get_author(), and serialise().


The documentation for this class was generated from the following files:
Generated on Fri Jan 11 10:01:33 2008 for obby by  doxygen 1.5.1