/* */ #ifndef _D_OPTION_H_ #define _D_OPTION_H_ #include "common.h" #include #include namespace aria2 { class Option { private: std::map table_; public: Option(); ~Option(); void put(const std::string& name, const std::string& value); // Returns true if name is defined. Otherwise returns false. // Note that even if the value is a empty string, this method returns true. bool defined(const std::string& name) const; // Returns true if name is not defined or the value is a empty string. // Otherwise returns false. bool blank(const std::string& name) const; const std::string& get(const std::string& name) const; int32_t getAsInt(const std::string& name) const; int64_t getAsLLInt(const std::string& name) const; bool getAsBool(const std::string& name) const; double getAsDouble(const std::string& name) const; void remove(const std::string& name); void clear(); std::map::const_iterator begin() const { return table_.begin(); } std::map::const_iterator end() const { return table_.end(); } }; } // namespace aria2 #endif // _D_OPTION_H_