/*---------------------------------------------------------------------------* Copyright (C) 2013-2014 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. *---------------------------------------------------------------------------*/ #ifndef NN_EC_DATA_SIZE_H_ #define NN_EC_DATA_SIZE_H_ #include namespace nn { namespace ec { //! @addtogroup nn_ec_class //! @{ /*! @brief Class for handling a data size. */ class DataSize : public RootObject { public: /*! @brief Specifies the maximum length of the data size string. */ static const size_t STRING_LENGTH_MAX = 6; /*! @brief Specifies the size of the data size string. */ static const size_t STRING_SIZE = STRING_LENGTH_MAX + 1; public: /*! @brief Enumerates the units of a data size. The Wii U system handles units up to GB. */ enum Unit { UNIT_KB = 1, //!< Kilobytes. UNIT_MB = 2, //!< Megabytes. UNIT_GB = 3, //!< Gigabytes. UNIT_TB = 4, //!< Terabytes. UNIT_PB = 5, //!< Petabytes. UNIT_EB = 6, //!< Exabytes. UNIT_MAX, UNIT_FORCE_S32 = 0x7FFFFFFF }; public: /*! @brief Instantiates the object. @param[in] value Specifies the data size. */ explicit DataSize(u64 value = 0); /*! @brief Gets a value. Use the value retrieved with this function for size calculations. @n To display the data size, use the string retrieved with @ref GetString. @return Returns the value. */ u64 GetValue() const; /*! @brief Gets the data size as a string. The decimal point of the data size string becomes a period if the @ref DataSize object was created before @ref Login. @n This is because there is no local information before @ref Login, so the decimal point is indeterminate. @return Returns the data size string. */ const char* GetString() const; /*! @brief Gets the unit. @return Returns the unit. */ Unit GetUnit() const; /*! @brief Gets the unit as a string. @return Returns the unit string. */ const char* GetUnitString() const; private: // u64 m_value; // u8 m_unit; // char m_string[STRING_SIZE]; }; //! @} }} // namespace nn::ec #endif // NN_EC_DATA_SIZE_H_