📄 mpitems.h
字号:
*/ class MpFrom : public MpNameAddrParm { public: MpFrom() : MpNameAddrParm(mpiFromParm, sipProtoNameL) { setHeaderInfo(hdrnFrom, false, false); } virtual ~MpFrom() {} virtual MpHeader * clone() const { return new MpFrom; } void operator = (const std::mstring & str) { decode(str); } private: MpFrom(const MpFrom &); MpFrom & operator = (const MpFrom &); }; /**To Header * to.val(mpnDispName) * to.val(mpnComment) * to[mpiUrl][...] * to[mpiParm].val(...) */ class MpTo : public MpNameAddrParm { public: MpTo() : MpNameAddrParm(mpiToParm, sipProtoNameL) { setHeaderInfo(hdrnTo, false, false); } virtual ~MpTo() {} virtual MpHeader * clone() const { return new MpTo; } void operator = (const std::mstring & str) { decode(str); } private: MpTo(const MpTo &); MpTo & operator = (const MpTo &); }; /**Hide Header * hide.val(mpnValue) */ class MpHide : public MpValue { public: MpHide() { setHeaderInfo(hdrnHide, false, false); } virtual ~MpHide() {} virtual MpHeader * clone() const { return new MpHide; } virtual void checkSyntax() const; void operator = (const std::mstring & str) { decode(str); } private: MpHide(const MpHide &); MpHide & operator = (const MpHide &); }; /**Max-Forwards Header * max_forw.val(mpnValue) */ class MpMaxForwards : public MpValue { public: MpMaxForwards() { setHeaderInfo(hdrnMaxForwards, false, false); } virtual ~MpMaxForwards() {} virtual MpHeader * clone() const { return new MpMaxForwards; } virtual void checkSyntax() const; void operator = (const std::mstring & str) { decode(str); } private: MpMaxForwards(const MpMaxForwards &); MpMaxForwards & operator = (const MpMaxForwards &); }; /**Organization Header * org.val(mpnValue) */ class MpOrganization : public MpValue { public: MpOrganization() { setHeaderInfo(hdrnOrganization, false, false); } virtual ~MpOrganization() {} virtual MpHeader * clone() const { return new MpOrganization; } void operator = (const std::mstring & str) { decode(str); } private: MpOrganization(const MpOrganization &); MpOrganization & operator = (const MpOrganization &); }; /**Subject Header * subj.val(mpnValue) */ class MpSubject : public MpValue { public: MpSubject() { setHeaderInfo(hdrnSubject, false, false); } virtual ~MpSubject() {} virtual MpHeader * clone() const { return new MpSubject; } void operator = (const std::mstring & str) { decode(str); } private: MpSubject(const MpSubject &); MpSubject & operator = (const MpSubject &); }; /**Priority Header * prior.val(mpnValue) */ class MpPriority : public MpValue { public: MpPriority() { setHeaderInfo(hdrnPriority, false, false); } virtual ~MpPriority() {} virtual MpHeader * clone() const { return new MpPriority; } virtual void checkSyntax() const; void operator = (const std::mstring & str) { decode(str); } private: MpPriority(const MpPriority &); MpPriority & operator = (const MpPriority &); }; /**Proxy-Authenticate Header !!!May be refined in future * proxy_authen.val(mpnValue) */ class MpProxyAuthenticate : public MpValue { public: MpProxyAuthenticate() { setHeaderInfo(hdrnProxyAuthenticate, false, false); } virtual ~MpProxyAuthenticate() {} virtual MpHeader * clone() const { return new MpProxyAuthenticate; } void operator = (const std::mstring & str) { decode(str); } private: MpProxyAuthenticate(const MpProxyAuthenticate &); MpProxyAuthenticate & operator = (const MpProxyAuthenticate &); }; /**Proxy-Authorization Header !!!May be refined in future * proxy_author.val(mpnValue) */ class MpProxyAuthorization : public MpValue { public: MpProxyAuthorization() { setHeaderInfo(hdrnProxyAuthorization, false, false); } virtual ~MpProxyAuthorization() {} virtual MpHeader * clone() const { return new MpProxyAuthorization; } void operator = (const std::mstring & str) { decode(str); } private: MpProxyAuthorization(const MpProxyAuthorization &); MpProxyAuthorization & operator = (const MpProxyAuthorization &); }; /**Proxy-Require Header !!!May be refined in future * proxy_require.val(mpnValue) */ class MpProxyRequire : public MpValue { public: MpProxyRequire() { setHeaderInfo(hdrnProxyRequire, false, false); } virtual ~MpProxyRequire() {} virtual MpHeader * clone() const { return new MpProxyRequire; } void operator = (const std::mstring & str) { decode(str); } private: MpProxyRequire(const MpProxyRequire &); MpProxyRequire & operator = (const MpProxyRequire &); }; /**Route Header. * route[mpiHostPort].val(mpnHost) * route[mpiHostPort].val(mpnPort) * route[mpiUserInfo].val(mpnUser) * route[mpiUserInfo].val(mpnPasswd) */ class MpRoute : public MpHeader { MpUrl mp_Url; public: MpRoute() : mp_Url(sipProtoNameL) { setHeaderInfo(hdrnRoute, true, false); } virtual ~MpRoute() {} virtual MpHeader * clone() const { return new MpRoute; } virtual std::mstring encode(bool chk_syntax_flag=true) const; virtual void decode(const std::mstring & str, bool chk_syntax_flag=true); virtual void checkSyntax() const { mp_Url.checkSyntax(); } virtual void erase() { mp_Url.erase(); } virtual bool empty() const { return mp_Url.empty(); } virtual MpParseItem & operator [] (const char * name) { return mp_Url[name]; } virtual std::mstring & val(const char * name) { return mp_Url.val(name); } virtual unsigned valCount() const { return mp_Url.valCount(); } virtual unsigned itemCount() const { return mp_Url.itemCount(); } virtual void get(unsigned i, std::mstring *name, std::mstring *value) const { mp_Url.get(i, name, value); } virtual MpParseItem & item(unsigned i, std::mstring *name) { return mp_Url.item(i, name); } void operator = (const std::mstring & str) { decode(str); } private: MpRoute(const MpRoute &); MpRoute & operator = (const MpRoute &); }; /**Record-Route Header. * rec_route[mpiHostPort].val(mpnHost) * rec_route[mpiHostPort].val(mpnPort) * rec_route[mpiUserInfo].val(mpnUser) * rec_route[mpiUserInfo].val(mpnPasswd) */ class MpRecordRoute : public MpRoute { public: MpRecordRoute() { setHeaderInfo(hdrnRecordRoute, false, false); } virtual ~MpRecordRoute() {} virtual MpHeader * clone() const { return new MpRecordRoute; } void operator = (const std::mstring & str) { decode(str); } private: MpRecordRoute(const MpRecordRoute &); MpRecordRoute & operator = (const MpRecordRoute &); }; /**Require Header !!!May be refined in future * require.val(mpnValue) */ class MpRequire : public MpValue { public: MpRequire() { setHeaderInfo(hdrnRequire, true, true); } virtual ~MpRequire() {} virtual MpHeader * clone() const { return new MpRequire; } void operator = (const std::mstring & str) { decode(str); } private: MpRequire(const MpRequire &); MpRequire & operator = (const MpRequire &); }; /**Unsupported Header !!!May be refined in future * unsup.val(mpnValue) */ class MpUnsupported : public MpValue { public: MpUnsupported() { setHeaderInfo(hdrnUnsupported, true, true); } virtual ~MpUnsupported() {} virtual MpHeader * clone() const { return new MpUnsupported; } void operator = (const std::mstring & str) { decode(str); } private: MpUnsupported(const MpUnsupported &); MpUnsupported & operator = (const MpUnsupported &); }; /**WWW-Authenticate Header !!!May be refined in future * unsup.val(mpnValue) */ class MpWWWAuthenticate : public MpValue { public: MpWWWAuthenticate() { setHeaderInfo(hdrnWWWAuthenticate, true, true); } virtual ~MpWWWAuthenticate() {} virtual MpHeader * clone() const { return new MpWWWAuthenticate; } void operator = (const std::mstring & str) { decode(str); } private: MpWWWAuthenticate(const MpWWWAuthenticate &); MpWWWAuthenticate & operator = (const MpWWWAuthenticate &); }; /**Response-Key Header !!!May be refined in future * resp_key.val(mpnValue) */ class MpResponseKey : public MpValue { public: MpResponseKey() { setHeaderInfo(hdrnResponseKey, false, false); } virtual ~MpResponseKey() {} virtual MpHeader * clone() const { return new MpResponseKey; } void operator = (const std::mstring & str) { decode(str); } private: MpResponseKey(const MpResponseKey &); MpResponseKey & operator = (const MpResponseKey &); }; /**Retry-After Header. * retry-after.val(mpnDate) * retry-after.val(mpnSeconds) * retry-after.val(mpnDuration) * retry-after.val(mpnComment) */ class MpRetryAfter : public MpHeader { std::mstring mp_Date; std::mstring mp_Seconds; std::mstring mp_Duration; std::mstring mp_Comment; public: MpRetryAfter() { setHeaderInfo(hdrnRetryAfter, false, false); } virtual ~MpRetryAfter() {} virtual MpHeader * clone() const { return new MpRetryAfter; } virtual std::mstring encode(bool chk_syntax_flag=true) const; virtual void decode(const std::mstring & str, bool chk_syntax_flag=true); virtual void checkSyntax() const; virtual void erase(); virtual bool empty() const { return mp_Date.empty() && mp_Seconds.empty(); } virtual MpParseItem & operator [] (const char * name); virtual std::mstring & val(const char * name); virtual unsigned valCount() const { return 4; } virtual void get(unsigned i, std::mstring *name, std::mstring *value) const; void operator = (const std::mstring & str) { decode(str); } private: MpRetryAfter(const MpRetryAfter &); MpRetryAfter & operator = (const MpRetryAfter &); }; /**Server Header !!!May be refined in future * server.val(mpnValue) */ class MpServer : public MpValue { public: MpServer() { setHeaderInfo(hdrnServer, false, false); } virtual ~MpServer() {} virtual MpHeader * clone() const { return new MpServer; } void operator = (const std::mstring & str) { decode(str); } private: MpServer(const MpServer &); MpServer & operator = (const MpServer &); }; /**User-Agent Header !!!May be refined in future * user_agent.val(mpnValue) */ class MpUserAgent : public MpValue { public: MpUserAgent() { setHeaderInfo(hdrnUserAgent, false, false); } virtual ~MpUserAgent() {} virtual MpHeader * clone() const { return new MpUserAgent; } void operator = (const std::mstring & str) { decode(str); } private: MpUserAgent(const MpUserAgent &); MpUserAgent & operator = (const MpUserAgent &); }; /**Timestamp Header * tmstamp.val(mpnValue) * tmstamp.val(mpnDelay) */ class MpTimestamp : public MpValue { public: MpTimestamp(); virtual ~MpTimestamp() {} virtual MpHeader * clone() const { return new MpTimestamp; } virtual void checkSyntax() const; void operator = (const std::mstring & str) { decode(str); } private: MpTimestamp(const MpTimestamp &); MpTimestamp & operator = (const MpTimestamp &); }; /**Via Header * via.val(mpnProto) * via.val(mpnVersion) * via.val(mpnTransport) * via.val(mpnComment) * via[mpiSentBy].val(mpnHost) * via[mpiSentBy].val(mpnPort) * via[mpiUrlParm].val(...) */ class MpVia : public MpValue { MpHostPort mp_HostPort; MpUrlParm mp_UrlParm; std::mstring mp_Comment; public: MpVia(); virtual ~MpVia() {} virtual MpHeader * clone() const { return new MpVia; } virtual std::mstring encode(bool chk_syntax_flag=true) const; virtual void decode(const std::mstring & str, bool chk_syntax_flag=true); virtual void checkSyntax() const; virtual void erase() { MpValue::erase(); mp_HostPort.erase(); mp_UrlParm.erase(); } virtual bool empty() const { return MpValue::empty() || mp_HostPort.empty(); } virtual MpParseItem & operator [] (const char * name); virtual std::mstring & val(const char * name); virtual unsigned valCount() const { return 4; } virtual unsigned itemCount() const { return 2; } virtual void get(unsigned i, std::mstring *name, std::mstring *value) const; virtual MpParseItem & item(unsigned i, std::mstring *name); void operator = (const std::mstring & str) { decode(str); } private: MpVia(const MpVia &); MpVia & operator = (const MpVia &); }; /**Warning Header * warn.val(mpnCode) * warn.val(mpnAgent) * warn.val(mpnText) */ class MpWarning : public MpValue { public: MpWarning(); virtual ~MpWarning() {} virtual MpHeader * clone() const { return new MpWarning; } virtual void checkSyntax() const; void operator = (const std::mstring & str) { decode(str); } private: MpWarning(const MpWarning &); MpWarning & operator = (const MpWarning &); };}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -