DomainPlug-insDocumentation
DMToolKit.h
Go to the documentation of this file.
00001 #ifndef _DM_TOOLKIT_H_
00002 #define _DM_TOOLKIT_H_
00003 
00004 #include <stlrt/atypes.h>
00005 #include <Comm/atracer.h>
00006 
00007 #include "pluginconfig.h"
00008 #include "constants/domain.h"
00009 
00010 namespace ToolKit{
00011 
00012 typedef std::pair<std::string, std::string> string_pair;
00013 PLUGINTOOLKIT_DECL void secureRequestPart(std::string &text, std::string sBeg, std::string sEnd);
00014 PLUGINTOOLKIT_DECL std::string secureRequest(const std::string &src, const std::vector<string_pair> &borders);
00015 
00016 PLUGINTOOLKIT_DECL bool isEmailValid (const Str &email);
00017 PLUGINTOOLKIT_DECL bool isEmailValidThrow (const Str &email);
00018 PLUGINTOOLKIT_DECL bool isDomainNameValid (const Str &name);
00019 PLUGINTOOLKIT_DECL bool isWildcardDomainNameValid (const Str &name);
00020 
00021 PLUGINTOOLKIT_DECL Str to_ascii (const Str&);
00022 PLUGINTOOLKIT_DECL Str to_utf (const Str&);
00023 PLUGINTOOLKIT_DECL bool is_idn (const Str&);
00024 
00025 PLUGINTOOLKIT_DECL Str generate_passwd (size_t min_length = 8, size_t max_length = 12);
00026 PLUGINTOOLKIT_DECL Str generate_login(const Str& pattern, size_t add_length = 20, bool except_digit = false);
00027 
00028 PLUGINTOOLKIT_DECL time_t date_from_string (const char * s);
00029 PLUGINTOOLKIT_DECL time_t date_from_string (const Str& s);
00030 PLUGINTOOLKIT_DECL Str string_from_date (const time_t timestmp);
00031 PLUGINTOOLKIT_DECL Str transliterate (const Str &mbstr);
00032 
00033 PLUGINTOOLKIT_DECL Str country_name_by_2c(const Str &code2c);
00034 PLUGINTOOLKIT_DECL Str country_name_by_3c(const Str &code3c);
00035 PLUGINTOOLKIT_DECL Str country_name_by_code(int code);
00036 PLUGINTOOLKIT_DECL Str country_3c_by_2c(const Str &code2c);
00037 PLUGINTOOLKIT_DECL int country_code_by_2c(const Str &code2c);
00038 PLUGINTOOLKIT_DECL Str country_3c_by_code(int code);
00039 PLUGINTOOLKIT_DECL Str country_2c_by_code(int code);
00040 PLUGINTOOLKIT_DECL vector<Str> get_ns_by_domain( const Str sDomainName );
00041 PLUGINTOOLKIT_DECL vector<Str> get_ip_by_domain( const Str sDomainName );
00042 };
00043 
00044 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines