/*---------------------------------------------------------------------------* Project: Horizon File: NinjaXmlReader.h Copyright (C)2015 Nintendo Co., Ltd. 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. $Rev$ *---------------------------------------------------------------------------*/ #ifndef SOURCES_CONSOLERESTORE_NINJAXMLREADER_H_ #define SOURCES_CONSOLERESTORE_NINJAXMLREADER_H_ #include #include #include namespace ConsoleRestore { //!@brief Ninjaから取得したXMLデータ読み取るためのクラスです class NinjaXmlReader { public: NinjaXmlReader(); virtual ~NinjaXmlReader(); //!@brief XMLをパースしてns_uidを取得します //!@param[out] pNsUid ns_uidを格納するためのバッファ //!@param[in] size pNsUidのバッファサイズ //!@param[in] xml Ninjaから取得したXMLデータ void GetNsUid(std::string& nsUid, std::string xml); //!@brief XMLをパースしてcontent_lock要素があるかどうかを返します //!@param[in] xml Ninjaから取得したXMLデータ //!@return content_lock要素があるかどうか bool HasContentLock(std::string xml); //!@brief XMLをパースしてexternal_seed要素があるかどうかを返します //!@param[in] xml Ninjaから取得したXMLデータ //!@return external_seed要素があるかどうか bool HasExternalSeed(std::string xml); //!@brief XMLをパースしてプレイ可能日を取得します //!@param[in] xml Ninjaから取得したXMLデータ //!@return DateTime型のプレイ可能日 nn::fnd::DateTime GetPlayableDate(std::string xml); private: bool HasElement(std::string xml, const char* element); bool GetContentOfElement(nn::xml::simple::SimpleXmlParser& parser, const char* element, std::string& content); bool GetElement(nn::xml::simple::SimpleXmlParser& parser, const char* element); void GetNodes( const nn::xml::simple::SimpleXmlParser::Node* topNodes, const char* target, std::string& content, bool& found); bool GetNodeName( const nn::xml::simple::SimpleXmlParser::Node* pNode, const char* target); void GetNodeContent( const nn::xml::simple::SimpleXmlParser::Node* pNode, bool found, std::string& content); }; } /* namespace ConsoleRestore */ #endif /* SOURCES_CONSOLERESTORE_NINJAXMLREADER_H_ */