|
reSIProcate
SIP stack, Dialog Usage Manager and related libraries
|
The base-class for all lazily-parsed SIP grammar elements. More...
#include <LazyParser.hxx>
Public Member Functions | |
| LazyParser (const HeaderFieldValue &headerFieldValue) | |
| LazyParser (const char *buf, int length) | |
| LazyParser (const HeaderFieldValue &headerFieldValue, HeaderFieldValue::CopyPaddingEnum e) | |
| LazyParser (const LazyParser &rhs) | |
| LazyParser (const LazyParser &rhs, HeaderFieldValue::CopyPaddingEnum e) | |
| LazyParser & | operator= (const LazyParser &rhs) |
| virtual | ~LazyParser () |
| virtual EncodeStream & | encodeParsed (EncodeStream &str) const =0 |
| virtual void | parse (ParseBuffer &pb)=0 |
| EncodeStream & | encode (EncodeStream &str) const |
| Encodes this element to a stream, in the fashion it should be represented on the wire. | |
| bool | isParsed () const |
| Returns true iff a parse has been attempted. | |
| HeaderFieldValue & | getHeaderField () |
| void | checkParsed () const |
| void | checkParsed () |
| void | doParse () const |
| void | markDirty () const |
| bool | isWellFormed () const |
| Returns true iff this element was parsed successfully, according to the implementation of parse(). | |
Protected Member Functions | |
| LazyParser () | |
| void | clear () |
| virtual const Data & | errorContext () const =0 |
Friends | |
| class | Contents |
The base-class for all lazily-parsed SIP grammar elements.
Subclasses of this are parse-on-access; the parse will be carried out (if it hasn't already) the first time one of the members is accessed. Right now, all header field values and SIP bodies are lazily parsed.
Application writers are expected to make consistent use of isWellFormed() in order to determine whether an element is parseable. Using a try/catch block around accesses will not work as expected, since an exception will only be thrown the first time an access is made, and it is determined that the element isn't parseable.
Definition at line 34 of file LazyParser.hxx.
|
explicit |
Definition at line 16 of file LazyParser.cxx.
| LazyParser::LazyParser | ( | const char * | buf, |
| int | length | ||
| ) |
Definition at line 28 of file LazyParser.cxx.
| LazyParser::LazyParser | ( | const HeaderFieldValue & | headerFieldValue, |
| HeaderFieldValue::CopyPaddingEnum | e | ||
| ) |
Definition at line 22 of file LazyParser.cxx.
| LazyParser::LazyParser | ( | const LazyParser & | rhs | ) |
Definition at line 39 of file LazyParser.cxx.
| LazyParser::LazyParser | ( | const LazyParser & | rhs, |
| HeaderFieldValue::CopyPaddingEnum | e | ||
| ) |
Definition at line 44 of file LazyParser.cxx.
|
virtual |
Definition at line 50 of file LazyParser.cxx.
|
protected |
Definition at line 33 of file LazyParser.cxx.
|
inline |
Definition at line 109 of file LazyParser.hxx.
|
inline |
Definition at line 102 of file LazyParser.hxx.
|
protected |
Definition at line 99 of file LazyParser.cxx.
| void LazyParser::doParse | ( | ) | const |
Definition at line 73 of file LazyParser.cxx.
| EncodeStream & LazyParser::encode | ( | EncodeStream & | str | ) | const |
Encodes this element to a stream, in the fashion it should be represented on the wire.
| str | The ostream to encode to. |
Definition at line 105 of file LazyParser.cxx.
|
pure virtual |
Implemented in resip::Auth, resip::CallID, resip::CpimContents, resip::CSeqCategory, resip::DateCategory, resip::DialogInfoContents, resip::DtmfPayloadContents, resip::ExpiresCategory, resip::GenericPidfContents, resip::GenericUri, resip::IdentityCategory, resip::IntegerCategory, resip::InvalidContents, resip::MediaControlContents, resip::MessageWaitingContents, resip::Mime, resip::MultipartMixedContents, resip::NameAddr, resip::OctetContents, resip::Pidf, resip::Pkcs7Contents, resip::Pkcs8Contents, resip::PlainContents, resip::PrivacyCategory, resip::RAckCategory, resip::RequestLine, resip::Rlmi, resip::SdpContents, resip::SipFrag, resip::StatusLine, resip::StringCategory, resip::Token, resip::TokenOrQuotedStringCategory, resip::UInt32Category, resip::Uri, resip::Via, resip::WarningCategory, resip::X509Contents, resip::StartLine, and resip::TrickleIceContents.
|
protectedpure virtual |
Implemented in resip::Contents, resip::ParserCategory, resip::RequestLine, resip::StatusLine, and resip::StartLine.
|
inline |
Definition at line 96 of file LazyParser.hxx.
|
inline |
Returns true iff a parse has been attempted.
Definition at line 91 of file LazyParser.hxx.
| bool LazyParser::isWellFormed | ( | ) | const |
Returns true iff this element was parsed successfully, according to the implementation of parse().
App writers are expected to use this extensively, since a failure in the parse-on-access will throw an exception the first time access is made, but nothing will happen on subsequent accesses. (Writing a try/catch block when you try to inspect the members of a subclass will only work as intended if the subclass hasn't been accessed before.)
Definition at line 85 of file LazyParser.cxx.
|
inline |
Definition at line 116 of file LazyParser.hxx.
| LazyParser & LazyParser::operator= | ( | const LazyParser & | rhs | ) |
Definition at line 56 of file LazyParser.cxx.
|
pure virtual |
Implemented in resip::Auth, resip::CallID, resip::CpimContents, resip::CSeqCategory, resip::DateCategory, resip::DialogInfoContents, resip::DtmfPayloadContents, resip::ExpiresCategory, resip::GenericPidfContents, resip::GenericUri, resip::IdentityCategory, resip::IntegerCategory, resip::InvalidContents, resip::MediaControlContents, resip::MessageWaitingContents, resip::Mime, resip::MultipartMixedContents, resip::NameAddr, resip::OctetContents, resip::Pidf, resip::Pkcs7Contents, resip::Pkcs8Contents, resip::PlainContents, resip::PrivacyCategory, resip::RAckCategory, resip::RequestLine, resip::Rlmi, resip::SdpContents, resip::SipFrag, resip::StatusLine, resip::StringCategory, resip::Token, resip::TokenOrQuotedStringCategory, resip::UInt32Category, resip::Uri, resip::Via, resip::WarningCategory, resip::X509Contents, resip::TrickleIceContents, and resip::StartLine.
|
friend |
Definition at line 140 of file LazyParser.hxx.