ircproxy  The Ultimate Cyborg

MessageIn::Part Class Reference

#include <MessageIn.h>

Inheritance diagram for MessageIn::Part:

MsgPart

List of all members.


Detailed Description

Part of an MessageIn.

Definition at line 44 of file MessageIn.h.


Public Member Functions

 Part (void)
 Construct an uninitialized Part.
 Part (char const *start, char const *end)
 Construct a Part with start start and end end.
void set (char const *start, char const *end)
 Initialize the Part.
void clear (void)
 Initialize an empty Part.
char const * start (void) const
 Return the start of the Part.
char const * end (void) const
 Return the end (exclusive) of the Part.
size_t len (void) const
 The size of the Part (end minus start).

Private Attributes

char const * M_ptr
 Pointer to the start of the Part.
size_t M_len
 The number of characters that belong to this Part.

Friends

std::ostream & operator<< (std::ostream &os, Part const &part)
 For debugging purposes. Write part to os.

Constructor & Destructor Documentation

MessageIn::Part::Part ( void   )  [inline]

Construct an uninitialized Part.

Definition at line 50 of file MessageIn.h.

00050 { }

MessageIn::Part::Part ( char const *  start,
char const *  end 
) [inline]

Construct a Part with start start and end end.

Definition at line 52 of file MessageIn.h.

00052 : M_ptr(start), M_len(end - start) { }


Member Function Documentation

void MessageIn::Part::set ( char const *  start,
char const *  end 
) [inline]

Initialize the Part.

Definition at line 54 of file MessageIn.h.

References end(), M_len, M_ptr, and start().

Referenced by MessageIn::init(), and MessageIn::params().

00054 { M_ptr = start; M_len = end - start; }

void MessageIn::Part::clear ( void   )  [inline]

Initialize an empty Part.

Definition at line 56 of file MessageIn.h.

References M_ptr.

Referenced by MessageIn::init(), and MessageIn::params().

00056 { M_ptr = NULL; }

char const* MessageIn::Part::start ( void   )  const [inline]

Return the start of the Part.

Definition at line 58 of file MessageIn.h.

References M_ptr.

Referenced by MessageIn::command_str(), MessageIn::has_prefix(), MessageIn::is_numeric(), MessageIn::prefix_str(), set(), JustInTimeMsgPart::value(), and JustInTimeMsgPart::write_to().

00058 { return M_ptr; }

char const* MessageIn::Part::end ( void   )  const [inline]

Return the end (exclusive) of the Part.

Definition at line 60 of file MessageIn.h.

References M_len, and M_ptr.

Referenced by set().

00060 { return M_ptr + M_len; }

size_t MessageIn::Part::len ( void   )  const [inline]

The size of the Part (end minus start).

Definition at line 62 of file MessageIn.h.

References M_len.

Referenced by MessageIn::command_str(), MessageIn::init(), MessageIn::prefix_str(), JustInTimeMsgPart::value(), and JustInTimeMsgPart::write_to().

00062 { return M_len; }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
Part const &  part 
) [friend]

For debugging purposes. Write part to os.

Definition at line 65 of file MessageIn.h.

00066         { return os << '"' << libcwd::buf2str(part.M_ptr, part.M_len) << '"'; }


Member Data Documentation

char const* MessageIn::Part::M_ptr [private]

Pointer to the start of the Part.

Definition at line 46 of file MessageIn.h.

Referenced by clear(), end(), set(), and start().

size_t MessageIn::Part::M_len [private]

The number of characters that belong to this Part.

Definition at line 47 of file MessageIn.h.

Referenced by end(), len(), and set().


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

Copyright © 2005-2007 Carlo Wood.  All rights reserved.