mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@839 385bec56-5757-e545-9c3a-d8741f4650f1
66 lines
2.8 KiB
C++
66 lines
2.8 KiB
C++
/*---------------------------------------------------------------------------*
|
|
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 <string>
|
|
#include <nn/fnd/fnd_DateTime.h>
|
|
#include <nn/xml/simple/xml_simple_SimpleXmlParser.h>
|
|
|
|
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_ */
|