reSIProcate/stack  9694
GenericUri.hxx
Go to the documentation of this file.
00001 #if !defined(RESIP_GENERIC_URI_HXX)
00002 #define RESIP_GENERIC_URI_HXX
00003 
00004 #include <iosfwd>
00005 #include "rutil/Data.hxx"
00006 #include "resip/stack/ParserCategory.hxx"
00007 #include "resip/stack/ParserContainer.hxx"
00008 
00009 namespace resip
00010 {
00011 
00016 class GenericUri : public ParserCategory
00017 {
00018    public:
00019       enum {commaHandling = CommasAllowedOutputMulti};
00020 
00021       GenericUri() : ParserCategory() {}
00022       GenericUri(const HeaderFieldValue& hfv, 
00023                   Headers::Type type,
00024                   PoolBase* pool=0);
00025       GenericUri(const GenericUri& orig,
00026                   PoolBase* pool=0);
00027       GenericUri& operator=(const GenericUri&);
00028 
00029       virtual void parse(ParseBuffer& pb);
00030       virtual ParserCategory* clone() const;
00031       virtual ParserCategory* clone(void* location) const;
00032       virtual ParserCategory* clone(PoolBase* pool) const;
00033       virtual EncodeStream& encodeParsed(EncodeStream& str) const;
00034 
00035       Data& uri();
00036       const Data& uri() const;
00037 
00038       // Inform the compiler that overloads of these may be found in
00039       // ParserCategory, too.
00040       using ParserCategory::exists;
00041       using ParserCategory::remove;
00042       using ParserCategory::param;
00043 
00044       virtual Parameter* createParam(ParameterTypes::Type type, ParseBuffer& pb, const std::bitset<256>& terminators, PoolBase* pool);
00045       // .bwc, This is an awful lot for one lousy param type.
00046       bool exists(const Param<GenericUri>& paramType) const;
00047       void remove(const Param<GenericUri>& paramType);
00048 
00049 #define defineParam(_enum, _name, _type, _RFC_ref_ignored)                      \
00050       const _enum##_Param::DType& param(const _enum##_Param& paramType) const;  \
00051       _enum##_Param::DType& param(const _enum##_Param& paramType); \
00052       friend class _enum##_Param
00053 
00054 defineParam(purpose, "purpose", DataParameter, "RFC 3261");
00055 
00056 #undef defineParam
00057 
00058    private:
00059       Data mUri;
00060 
00061       static ParameterTypes::Factory ParameterFactories[ParameterTypes::MAX_PARAMETER];
00062 };
00063 typedef ParserContainer<GenericUri> GenericUris;
00064 typedef GenericUri GenericURI; //.dcm. deprecated, should be removed soon
00065 }
00066 
00067 
00068 #endif
00069 /* ====================================================================
00070  * The Vovida Software License, Version 1.0 
00071  * 
00072  * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
00073  * 
00074  * Redistribution and use in source and binary forms, with or without
00075  * modification, are permitted provided that the following conditions
00076  * are met:
00077  * 
00078  * 1. Redistributions of source code must retain the above copyright
00079  *    notice, this list of conditions and the following disclaimer.
00080  * 
00081  * 2. Redistributions in binary form must reproduce the above copyright
00082  *    notice, this list of conditions and the following disclaimer in
00083  *    the documentation and/or other materials provided with the
00084  *    distribution.
00085  * 
00086  * 3. The names "VOCAL", "Vovida Open Communication Application Library",
00087  *    and "Vovida Open Communication Application Library (VOCAL)" must
00088  *    not be used to endorse or promote products derived from this
00089  *    software without prior written permission. For written
00090  *    permission, please contact vocal@vovida.org.
00091  *
00092  * 4. Products derived from this software may not be called "VOCAL", nor
00093  *    may "VOCAL" appear in their name, without prior written
00094  *    permission of Vovida Networks, Inc.
00095  * 
00096  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
00097  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00098  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
00099  * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
00100  * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
00101  * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
00102  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00103  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00104  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00105  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00106  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00107  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00108  * DAMAGE.
00109  * 
00110  * ====================================================================
00111  * 
00112  * This software consists of voluntary contributions made by Vovida
00113  * Networks, Inc. and many individuals on behalf of Vovida Networks,
00114  * Inc.  For more information on Vovida Networks, Inc., please see
00115  * <http://www.vovida.org/>.
00116  *
00117  */