// Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos. // All rights reserved. // Code licensed under the BSD License. // http://www.anki3d.org/LICENSE #pragma once #include #include namespace anki { /// @addtogroup misc /// @{ /// A storage of configuration variables. class ConfigSet { public: ConfigSet(); /// Copy. ConfigSet(const ConfigSet& b) { operator=(b); } ~ConfigSet(); /// Copy. ConfigSet& operator=(const ConfigSet& b); /// @name Set an option /// @{ void set(const CString& name, const CString& value); void set(const CString& name, F64 value); /// @} /// @name Find an option and return it's value. /// @{ F64 getNumber(const CString& name) const; CString getString(const CString& name) const; /// @} protected: void newOption(const CString& name, const CString& value); void newOption(const CString& name, F64 value); private: class Option : public NonCopyable { public: String m_name; String m_strVal; F64 m_fVal = 0.0; U8 m_type = 0; ///< 0: string, 1: float Option() = default; Option(Option&& b) : m_name(std::move(b.m_name)) , m_strVal(std::move(b.m_strVal)) , m_fVal(b.m_fVal) , m_type(b.m_type) { } ~Option() = default; Option& operator=(Option&& b) = delete; }; HeapAllocator m_alloc; List