00001 // OSB library ************************************************ -*- C++ -*- 00006 /* 00007 AUTHOR(S): Stephan Broennimann (vb) 00008 00009 RCS information 00010 $Name: OSB_060808 $ 00011 $Revision: 1.5 $ 00012 00013 License 00014 OSB rating and billing library for communication networks 00015 Copyright (C) 2004, 2005, 2006 OSB systems 00016 00017 This file may be distributed and/or modify under the terms of the 00018 GNU General Public License (GPL) as published by the Free Software 00019 Foundation which is provided in the file LICENSE.GPL included in the 00020 packaging of this file. 00021 00022 The file is distributed in the hope that it will be useful, but WITHOUT 00023 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00024 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00025 for more details. 00026 00027 Holders of a OSB Commercial License may use this file under the terms 00028 and conditions of this commercial license. 00029 */ 00030 #ifndef _NORMNWADDRESS_H_ 00031 #define _NORMNWADDRESS_H_ 00032 00033 // ************************************************************************ 00034 // included header files 00035 // + standard includes 00036 #include <string> 00037 00038 // + libraries 00039 00040 // + local headers 00041 #include "nwaddress.h" 00042 #include "osberror.h" 00043 #include "osbid.h" 00044 00045 // + class declarations 00046 namespace OSB_LIB { 00047 class Network; 00048 class NetworkElement; 00049 } 00050 00051 // ************************************************************************ 00052 // namespace extensions 00053 namespace OSB_LIB { 00054 00055 // ************************************************************************ 00056 // forward declarations 00057 00058 // ************************************************************************ 00059 // type definitions 00060 00061 // ************************************************************************ 00062 // class definitions 00074 class NormNwAddress { 00075 public: // class specific exceptions 00077 class NpNotSupported : public OsbException { 00078 static const ErrorNo errNo = 555; 00079 public: 00081 NpNotSupported(NwAddress::Np np); 00082 }; 00083 public: 00094 static bool normalize( 00095 NwAddress& addr, 00096 const Network& nw, 00097 const Id2<NetworkElement>& neId 00098 ); 00099 00105 static void getCountry(NwAddress& addr); 00106 00107 private: 00119 static bool normalizeE164( 00120 NwAddress& addr, 00121 const Network& nw, 00122 const Id2<NetworkElement>& neId, 00123 NwAddress::Ton ton, 00124 const std::string& src 00125 ); 00126 }; // class NormNwAddress 00127 } // namespace OSB_LIB 00128 00129 // ************************************************************************ 00130 // inline definitions 00131 namespace OSB_LIB { 00132 } // namespace OSB_LIB 00133 #endif // #ifndef _NORMNWADDRESS_H_