Main Page | Class List | File List | Class Members | File Members

GeoIPWrapper.h

Go to the documentation of this file.
00001 /* -*- Mode: C++ -*- */
00002 /* GeoIPWrapper.h
00003  *
00004  * Copyright (C) 2005 Guwashi <guwashi[AT]fooos[DOT]com>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 #ifndef _GEOIPWRAPPER_H_
00022 #define _GEOIPWRAPPER_H_
00023 
00024 #include "GeoIP.h"
00025 
00026 class GeoIPWrapper
00027 {
00028 private:
00029   GeoIP* m_gi;
00030 
00031 public:
00032   GeoIPWrapper(char* filename, int flags);
00033   GeoIPWrapper(int flags);
00034   ~GeoIPWrapper();
00035   const char* getCountryCodeByName(const char* host) const;
00036   const char* getCountryCodeByAddr(const char* addr) const;
00037   const char* getCountryCode3ByName(const char* host) const;
00038   const char* getCountryCode3ByAddr(const char* addr) const;
00039   const char* getCountryNameByName(const char* host) const;
00040   const char* getCountryNameByAddr(const char* addr) const;
00041   int getIdByName(const char* host) const;
00042   int getIdByAddr(const char* addr) const;
00043   static const char* idToCountryCode(int countryId);
00044   static const char* idToCountryCode3(int countryId);
00045   static const char* idToCountryName(int countryId);
00046 };
00047 
00048 #endif //_GEOIPWRAPPER_H_

Generated on Tue Jun 28 01:09:07 2005 for CountryFilter by  doxygen 1.4.3-20050623