/* */ #ifndef D_OPTION_H #define D_OPTION_H #include "common.h" #include #include namespace aria2 { class Pref; class Option { private: std::vector table_; std::vector use_; public: Option(); ~Option(); Option(const Option& option); Option& operator=(const Option& option); void put(const Pref* pref, 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 Pref* pref) const; // Returns true if name is not defined or the value is a empty string. // Otherwise returns false. bool blank(const Pref* pref) const; const std::string& get(const Pref* pref) const; int32_t getAsInt(const Pref* pref) const; int64_t getAsLLInt(const Pref* pref) const; bool getAsBool(const Pref* pref) const; double getAsDouble(const Pref* pref) const; void remove(const Pref* pref); void clear(); const std::vector& getTable() const { return table_; } // Copy option values defined in option to this option. void merge(const Option& option); }; } // namespace aria2 #endif // D_OPTION_H