📄 warurltype.h
字号:
/** */#ifndef WAR_URL_TYPE_H#define WAR_URL_TYPE_H/* SYSTEM INCLUDES */#ifndef WAR_MAP_INCLUDED# define WAR_MAP_INCLUDED# include <map>#endif/* PROJECT INCLUDES */#ifndef WAR_EXCEPTION_H# include "WarException.h"#endif/* LOCAL INCLUDES *//* FORWARD REFERENCES */#ifdef __cplusplusextern "C" {#endif/****************** BEGIN OLD STYLE C spesific ********//****************** END OLD STYLE C spesific **********/#ifdef __cplusplus }#endif/****************** BEGIN C++ spesific ****************/#ifdef __cplusplusclass WarUrlType {public: typedef std::map<std::string, WarUrlType *> typemap_t; enum ProtocolStyleE { S_HTTP, S_FTP, S_GENERIC }; // LIFECYCLE /** * Default constructor. */ WarUrlType(); /** * Copy constructor. * * @param from The value to copy to this object. */ WarUrlType(const WarUrlType& from); WarUrlType(war_ccstr_t tagName); /** * Destructor. */ ~WarUrlType(); // OPERATORS /** * Assignment operator. * * @param from The value to assign to this object. * * @return A reference to this object. */ WarUrlType& operator = (const WarUrlType& from); /** Checks if the tag matches the type * ie: if (my_url_type == "http") */ bool operator == (war_ccstr_t urlTag); // OPERATIONS void Create(war_ccstr_t fullUrl) throw(WarException); void Reset(); static void DefineUrlType(war_ccstr_t urlTag, ProtocolStyleE urlStyle, bool isHostscanRequired, bool isFilepathRequired); /** Global initialization. Must be called before * URL's are used! */ static void Initialize(); // ACCESS // INQUIRY /** Return the tag part og the fullUrl identifier, * ie: "http" */ const std::string& GetUrlTag() const throw(WarException); /** Return the fullUrl identifier * ie: "http://" */ const std::string GetUrlName() const throw(WarException); /** Get the length of the full fullUrl identifier, * ie: strlen("http://" */ size_t GetLenght() throw(WarException); bool IsHostscanRequiered() const throw(WarException); bool IsFilePathRequired() const throw(WarException); ProtocolStyleE GetStyle(); bool IsEmpty() const;protected:private: std::string mTagName; bool mDoHostscan; bool mDoFilePath; ProtocolStyleE mStyle; static typemap_t mDefinedTypes;};/* INLINE METHODS *//* EXTERNAL REFERENCES */#endif /* __cplusplus *//****************** END C++ spesific ******************/#endif /* WAR_URL_TYPE_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -