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 PLUGINTOOLKIT_DECL bool validateEmail (Str email); 00013 PLUGINTOOLKIT_DECL Str to_ascii (const Str&); 00014 PLUGINTOOLKIT_DECL Str to_utf (const Str&); 00015 PLUGINTOOLKIT_DECL bool is_idn (const Str&); 00016 00017 PLUGINTOOLKIT_DECL Str generate_passwd (size_t min_length = 8, size_t max_length = 12); 00018 PLUGINTOOLKIT_DECL Str generate_login(const Str& pattern, size_t add_length = 20, bool except_digit = false); 00019 00020 PLUGINTOOLKIT_DECL time_t date_from_string (const char * s); 00021 PLUGINTOOLKIT_DECL Str string_from_date (const time_t timestmp); 00022 PLUGINTOOLKIT_DECL Str transliterate (const Str &mbstr); 00023 00024 PLUGINTOOLKIT_DECL Str country_name_by_2c(const Str &code2c); 00025 PLUGINTOOLKIT_DECL Str country_name_by_3c(const Str &code3c); 00026 PLUGINTOOLKIT_DECL Str country_name_by_code(int code); 00027 PLUGINTOOLKIT_DECL Str country_3c_by_2c(const Str &code2c); 00028 PLUGINTOOLKIT_DECL int country_code_by_2c(const Str &code2c); 00029 PLUGINTOOLKIT_DECL Str country_3c_by_code(int code); 00030 PLUGINTOOLKIT_DECL Str country_2c_by_code(int code); 00031 PLUGINTOOLKIT_DECL vector<Str> get_ns_by_domain( const Str sDomainName ); 00032 }; 00033 00034 #endif