FDO API Reference Feature Data Objects

ProviderNameTokens.h

Go to the documentation of this file.
00001 #ifndef _FDOPROVIDERNAMETOKENS_H_
00002 #define _FDOPROVIDERNAMETOKENS_H_
00003 /***************************************************************************
00004 
00005 //
00006 // Copyright (C) 2004-2006  Autodesk, Inc.
00007 // 
00008 // This library is free software; you can redistribute it and/or
00009 // modify it under the terms of version 2.1 of the GNU Lesser
00010 // General Public License as published by the Free Software Foundation.
00011 // 
00012 // This library is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 // Lesser General Public License for more details.
00016 // 
00017 // You should have received a copy of the GNU Lesser General Public
00018 // License along with this library; if not, write to the Free Software
00019 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 //
00021 
00022 
00023  ***************************************************************************/
00024 #ifdef _WIN32
00025 #pragma once
00026 #endif
00027 
00028 // Include definitions
00029 #include <FdoStd.h>
00030 #include <FdoCommon.h>
00031 #include <Common/Vector.h>
00032 #include <Fdo/ClientServices/ClientServices.h>
00033 
00034 /// \brief
00035 /// A provider name tokenized into its company, name and version parts.
00036 class FdoProviderNameTokens : public FdoIDisposable
00037 {
00038 public:
00039     /// \brief
00040     /// Tokenize a full provider name
00041     /// The name is usually of the form "[Company].[Provider].[Version]",
00042     /// e.g. "Autodesk.Oracle.3.2".
00043     /// 
00044     /// \param names 
00045     /// Input the provider name to tokenize
00046     /// 
00047     /// \return
00048     /// Returns FdoProviderNameTokens
00049     /// 
00050     FDO_API static FdoProviderNameTokens* Create(FdoString* name);
00051 
00052     /// \brief
00053     /// Gets all of the tokens in this provider name
00054     /// 
00055     /// \return
00056     /// Returns the collection of tokens. 
00057     ///   Element 0 is the company
00058     ///   Element 1 is the unqualified name
00059     ///   the rest of the elements are the individual parts of the version number.
00060     /// 
00061     FDO_API  FdoStringsP GetNameTokens() const;
00062 
00063     /// \brief
00064     /// Gets all of the version number components in this provider name
00065     /// 
00066     /// \return
00067     /// Returns the collection of version number components. For
00068     /// example, if the full provider name is "Autodesk.Oracle.3.1" then 
00069     /// {3,1} is returned.
00070     /// 
00071     FDO_API  FdoVectorP GetVersionTokens() const;
00072 
00073     /// \brief
00074     /// Gets the local (unqualified) name of this provider.
00075     /// 
00076     /// \return
00077     /// Returns the local name ( without company and version ). For
00078     /// example, if the full provider name is "Autodesk.Oracle.3.1" then 
00079     /// "Oracle" is returned.
00080     /// 
00081     FDO_API  FdoStringP GetLocalName() const;
00082 
00083 protected:
00084 /// \cond DOXYGEN-IGNORE
00085     FdoProviderNameTokens() {}
00086     FdoProviderNameTokens(FdoString* name);
00087 
00088     /// Default destructor for FdoProvider.
00089     virtual ~FdoProviderNameTokens() {}
00090 
00091     virtual void Dispose();
00092 /// \endcond
00093 
00094 private:
00095     FdoStringsP mNameTokens;
00096     FdoStringsP mVersionTokens;
00097 };
00098 
00099 /// \brief
00100 /// FdoProviderNameTokensP is a FdoPtr on FdoProviderNameTokens, provided for convenience.
00101 /// It also provides operators for comparing two provider names.
00102 class FdoProviderNameTokensP : public FdoPtr<FdoProviderNameTokens>
00103 {
00104 public:
00105     /// \brief
00106     /// Tokenized provider name FdoPtr default constructor
00107     /// 
00108     /// \return
00109     /// Returns FdoProviderNameTokensP
00110     /// 
00111     FDO_API FdoProviderNameTokensP() {}
00112 
00113     /// \brief
00114     /// Tokenized provider name FdoPtr copy constructor
00115     /// 
00116     /// \param src 
00117     /// Input the source tokenized provider name as a FdoPtr
00118     /// 
00119     /// \return
00120     /// Returns FdoProviderNameTokensP
00121     /// 
00122     FDO_API FdoProviderNameTokensP( const FdoProviderNameTokensP& src ) 
00123         : FdoPtr<FdoProviderNameTokens>(src)
00124     {}
00125 
00126     /// \brief
00127     /// Tokenized provider name FdoPtr copy constructor
00128     /// 
00129     /// \param src 
00130     /// Input the source tokenized provider name as an object pointer
00131     /// 
00132     /// \return
00133     /// Returns FdoProviderNameTokensP
00134     /// 
00135     FDO_API FdoProviderNameTokensP( FdoProviderNameTokens* src )
00136         : FdoPtr<FdoProviderNameTokens>(src)
00137     {}
00138 
00139     /// \brief
00140     /// Tokenized provider name FdoPtr destructor
00141     /// 
00142     FDO_API ~FdoProviderNameTokensP() {}
00143  
00144     /// \brief
00145     /// Copies a tokenized provider name
00146     /// 
00147     /// \param src 
00148     /// Input the source collection
00149     /// 
00150     /// \return
00151     /// Returns the copy FdoProviderNameTokens
00152     /// 
00153     FDO_API FdoProviderNameTokens* operator=( FdoProviderNameTokens* src ); 
00154 
00155     /// \brief
00156     /// Compare two tokenized provider names for equality. The names are equal
00157     /// if all of their elements are equal. If one name is shorter than the other
00158     /// then it is treated as if it were padded with null elements to the length of the
00159     /// other name.
00160     /// 
00161     /// \param name2 
00162     /// Input provider name to compare this name
00163     /// 
00164     /// \return
00165     /// Returns true if the two names are identical.
00166     /// 
00167     FDO_API FdoBoolean operator==( const FdoProviderNameTokensP name2 ) const;
00168 
00169     /// \brief
00170     /// Compare two tokenized provider names for difference The names are different
00171     /// if at least one of their elements are different. If one name is shorter than the other
00172     /// then it is treated as if it were padded with null elements to the length of the
00173     /// other name.
00174     /// 
00175     /// \param name2 
00176     /// Input provider name to compare this name
00177     /// 
00178     /// \return
00179     /// Returns true if the two names are identical.
00180     /// 
00181     FDO_API FdoBoolean operator!=( const FdoProviderNameTokensP name2 ) const;
00182 
00183     /// \brief
00184     /// Checks if this provider name is greater than another provider name.
00185     /// This provider name is greater only if the company and name are the same, but
00186     /// this provider's version is later than that of name2. Therefore, it is 
00187     /// possible for a provider name to be neither greater than, equal or less than
00188     /// another provider name.
00189     /// 
00190     /// \param name2 
00191     /// The other provider name
00192     /// 
00193     /// \return
00194     /// Returns true if this provider name is greater than name2.
00195     /// 
00196     FDO_API FdoBoolean operator>( const FdoProviderNameTokensP name2 ) const;
00197 
00198     /// \brief
00199     /// Checks if this provider name is greater than or equal to another provider name.
00200     /// This provider name is greater only if the company and name are the same, but
00201     /// this provider's version is later than that of name2. Therefore, it is 
00202     /// possible for a provider name to be neither greater than, equal or less than
00203     /// another provider name.
00204     /// 
00205     /// \param name2 
00206     /// The other provider name
00207     /// 
00208     /// \return
00209     /// Returns true if this provider name is greater than or equal to name2.
00210     /// 
00211     FDO_API FdoBoolean operator>=( const FdoProviderNameTokensP name2 ) const;
00212 
00213     /// \brief
00214     /// Checks if this provider name is less than another provider name.
00215     /// This provider name is less than the other name only if the company and name are 
00216     /// the same, but
00217     /// this provider's version is earlier than that of name2. Therefore, it is 
00218     /// possible for a provider name to be neither greater than, equal or less than
00219     /// another provider name.
00220     /// 
00221     /// \param name2 
00222     /// The other provider name
00223     /// 
00224     /// \return
00225     /// Returns true if this provider name is less than name2.
00226     /// 
00227     FDO_API FdoBoolean operator<( const FdoProviderNameTokensP name2 ) const;
00228 
00229     /// \brief
00230     /// Checks if this provider name is less than or equal to another provider name.
00231     /// This provider name is less than the other name only if the company and name are 
00232     /// the same, but
00233     /// this provider's version is earlier than that of name2. Therefore, it is 
00234     /// possible for a provider name to be neither greater than, equal or less than
00235     /// another provider name.
00236     /// 
00237     /// \param name2 
00238     /// The other provider name
00239     /// 
00240     /// \return
00241     /// Returns true if this provider name is less than or equal to name2.
00242     /// 
00243     FDO_API FdoBoolean operator<=( const FdoProviderNameTokensP name2 ) const;
00244 
00245 protected:
00246 /// \cond DOXYGEN-IGNORE
00247     FdoBoolean Compare( const FdoProviderNameTokensP name2 ) const;
00248 
00249 };
00250 /// \endcond
00251 #endif
00252 
00253 

Comments or suggestions? Send us feedback.