oasys::TextCode Class Reference

#include <TextCode.h>

List of all members.


Detailed Description

Outputs a string that a certain column length with all non-printable ascii characters rewritten in hex.

A TextCode block ends with a single raw control-L character followed by a newline character (" \n") on a single line.

Definition at line 32 of file TextCode.h.


Public Member Functions

 TextCode (const char *input_buf, size_t length, ExpandableBuffer *buf, int cols, int pad)

Private Member Functions

bool is_not_escaped (char c)
 Whether or not the character is printable ascii.
void textcodify ()
 Perform the conversion.
void append (char c)
 Append a character to the text code.

Private Attributes

const char * input_buf_
size_t length_
StringBuffer buf_
int cols_
int pad_

Constructor & Destructor Documentation

oasys::TextCode::TextCode ( const char *  input_buf,
size_t  length,
ExpandableBuffer buf,
int  cols,
int  pad 
)

Parameters:
input_buf Input buffer
length Length of the input buffer
buf Buffer to put the text coded block into.
cols Number of characters to put in a column.
pad String to put in front of each line.

Definition at line 23 of file TextCode.cc.

References textcodify().


Member Function Documentation

bool oasys::TextCode::is_not_escaped ( char  c  )  [private]

Whether or not the character is printable ascii.

Definition at line 32 of file TextCode.cc.

Referenced by append().

void oasys::TextCode::textcodify (  )  [private]

Perform the conversion.

Definition at line 48 of file TextCode.cc.

References append(), oasys::StringBuffer::append(), buf_, cols_, input_buf_, length_, and pad_.

Referenced by TextCode().

void oasys::TextCode::append ( char  c  )  [private]

Append a character to the text code.

Definition at line 37 of file TextCode.cc.

References oasys::StringBuffer::append(), oasys::StringBuffer::appendf(), buf_, and is_not_escaped().

Referenced by textcodify().


Member Data Documentation

const char* oasys::TextCode::input_buf_ [private]

Definition at line 45 of file TextCode.h.

Referenced by textcodify().

size_t oasys::TextCode::length_ [private]

Definition at line 46 of file TextCode.h.

Referenced by textcodify().

StringBuffer oasys::TextCode::buf_ [private]

Definition at line 47 of file TextCode.h.

Referenced by append(), and textcodify().

int oasys::TextCode::cols_ [private]

Definition at line 49 of file TextCode.h.

Referenced by textcodify().

int oasys::TextCode::pad_ [private]

Definition at line 50 of file TextCode.h.

Referenced by textcodify().


The documentation for this class was generated from the following files:
Generated on Sat Sep 8 08:36:26 2007 for DTN Reference Implementation by  doxygen 1.5.3