|
reSIProcate/stack
9694
|
Represents a numeric-with-comment header field value. More...
#include <IntegerCategory.hxx>


Public Types | |
| enum | { commaHandling = NoCommaTokenizing } |
Public Member Functions | |
| IntegerCategory () | |
| IntegerCategory (const HeaderFieldValue &hfv, Headers::Type type, PoolBase *pool=0) | |
| IntegerCategory (const IntegerCategory &orig, PoolBase *pool=0) | |
| IntegerCategory & | operator= (const IntegerCategory &) |
| virtual void | parse (ParseBuffer &pb) |
| virtual EncodeStream & | encodeParsed (EncodeStream &str) const |
| virtual ParserCategory * | clone () const |
| virtual ParserCategory * | clone (void *location) const |
| virtual ParserCategory * | clone (PoolBase *pool) const |
| int | value () const |
| int & | value () |
| Data & | comment () |
| const Data & | comment () const |
Private Attributes | |
| int | mValue |
| Data | mComment |
Represents a numeric-with-comment header field value.
Definition at line 15 of file IntegerCategory.hxx.
| anonymous enum |
Definition at line 18 of file IntegerCategory.hxx.
| IntegerCategory::IntegerCategory | ( | ) |
Definition at line 18 of file IntegerCategory.cxx.
Referenced by clone().
: ParserCategory(), mValue(0), mComment() {}
| IntegerCategory::IntegerCategory | ( | const HeaderFieldValue & | hfv, |
| Headers::Type | type, | ||
| PoolBase * | pool = 0 |
||
| ) |
Definition at line 24 of file IntegerCategory.cxx.
: ParserCategory(hfv, type, pool), mValue(0), mComment() {}
| IntegerCategory::IntegerCategory | ( | const IntegerCategory & | orig, |
| PoolBase * | pool = 0 |
||
| ) |
Definition at line 32 of file IntegerCategory.cxx.
: ParserCategory(rhs, pool), mValue(rhs.mValue), mComment(rhs.mComment) {}
| ParserCategory * IntegerCategory::clone | ( | ) | const [virtual] |
Implements resip::ParserCategory.
Definition at line 51 of file IntegerCategory.cxx.
References IntegerCategory().
{
return new IntegerCategory(*this);
}

| ParserCategory * IntegerCategory::clone | ( | void * | location | ) | const [virtual] |
Implements resip::ParserCategory.
Definition at line 56 of file IntegerCategory.cxx.
References IntegerCategory().
{
return new (location) IntegerCategory(*this);
}

| ParserCategory * IntegerCategory::clone | ( | PoolBase * | pool | ) | const [virtual] |
Implements resip::ParserCategory.
Definition at line 62 of file IntegerCategory.cxx.
References IntegerCategory().
{
return new (pool) IntegerCategory(*this, pool);
}

| Data & IntegerCategory::comment | ( | ) |
Definition at line 87 of file IntegerCategory.cxx.
References resip::LazyParser::checkParsed(), and mComment.
{
checkParsed();
return mComment;
}

| const Data & IntegerCategory::comment | ( | ) | const |
Definition at line 74 of file IntegerCategory.cxx.
References resip::LazyParser::checkParsed(), and mComment.
{
checkParsed();
return mComment;
}

| EncodeStream & IntegerCategory::encodeParsed | ( | EncodeStream & | str | ) | const [virtual] |
Implements resip::LazyParser.
Definition at line 117 of file IntegerCategory.cxx.
References resip::Data::empty(), resip::ParserCategory::encodeParameters(), mComment, and mValue.
{
str << mValue;
if (!mComment.empty())
{
str << "(" << mComment << ")";
}
encodeParameters(str);
return str;
}

| IntegerCategory & IntegerCategory::operator= | ( | const IntegerCategory & | rhs | ) |
Definition at line 40 of file IntegerCategory.cxx.
References mComment, and mValue.
{
if (this != &rhs)
{
ParserCategory::operator=(rhs);
mValue = rhs.mValue;
mComment = rhs.mComment;
}
return *this;
}
| void IntegerCategory::parse | ( | ParseBuffer & | pb | ) | [virtual] |
Implements resip::LazyParser.
Definition at line 95 of file IntegerCategory.cxx.
References resip::ParseBuffer::data(), resip::ParseBuffer::eof(), resip::ParseBuffer::integer(), mComment, mValue, resip::ParserCategory::parseParameters(), resip::ParseBuffer::reset(), resip::ParseBuffer::skipChar(), resip::ParseBuffer::skipNonWhitespace(), resip::ParseBuffer::skipToChar(), resip::ParseBuffer::skipToEndQuote(), and resip::ParseBuffer::skipWhitespace().
{
const char* start = pb.skipWhitespace();
mValue = pb.integer();
pb.skipToChar('(');
if (!pb.eof())
{
start = pb.skipChar();
pb.skipToEndQuote(')');
pb.data(mComment, start);
pb.skipChar();
}
else
{
pb.reset(start);
start = pb.skipNonWhitespace();
}
parseParameters(pb);
}

| int IntegerCategory::value | ( | ) | const |
Definition at line 67 of file IntegerCategory.cxx.
References resip::LazyParser::checkParsed(), and mValue.
{
checkParsed();
return mValue;
}

| int & IntegerCategory::value | ( | ) |
Definition at line 80 of file IntegerCategory.cxx.
References resip::LazyParser::checkParsed(), and mValue.
{
checkParsed();
return mValue;
}

Data resip::IntegerCategory::mComment [private] |
Definition at line 41 of file IntegerCategory.hxx.
Referenced by comment(), encodeParsed(), operator=(), and parse().
int resip::IntegerCategory::mValue [private] |
Definition at line 40 of file IntegerCategory.hxx.
Referenced by encodeParsed(), operator=(), parse(), and value().
1.7.5.1