提交 b38129bc 编写于 作者: 小代码2016's avatar 小代码2016

khl_xml: document

上级 e128aec5
......@@ -48,5 +48,8 @@
"format": "cpp",
"*.in": "plaintext"
},
"editor.rulers": [120]
"editor.rulers": [
120
],
"cmake.configureOnOpen": true
}
\ No newline at end of file
......@@ -3,6 +3,7 @@
#include "khl_xml/khl_xml_version.h"
#include "khl_xml/khl_xml_node.h"
#include "khl_xml/khl_xml_document.h"
// C/C++ 跨平台时预处理判断平台环境
// 参考: https://www.cnblogs.com/Forgenvueory/p/12757271.html
......
......@@ -36,6 +36,4 @@
#define KHL_XML_NAMESPACE_BEGIN namespace khl { namespace xml {
#define KHL_XML_NAMESPACE_END };};
#endif // _KHL_XML_COMMON_H_
/**
* @file khl_xml_document.h
* @brief xml 文档类
*/
#ifndef _KHL_XML_DOCUMENT_CONFIG_H_
#define _KHL_XML_DOCUMENT_CONFIG_H_
#include <string>
#include "khl_xml_common.h"
#include "khl_xml_node.h"
KHL_XML_NAMESPACE_BEGIN
class XmlNode;
/**
* @brief xml 文档类
*/
class DllExport XmlDocument : public XmlNode
{
public:
XmlDocument();
~XmlDocument();
public:
std::string LoadFile();
};
KHL_XML_NAMESPACE_END
#endif // _KHL_XML_DOCUMENT_CONFIG_H_
\ No newline at end of file
/**
*
* @file khl_xml_node.h
* @brief 所有 xml 节点的基类
*/
#ifndef _KHL_XML_NODE_CONFIG_H_
......@@ -11,6 +12,9 @@
KHL_XML_NAMESPACE_BEGIN
/**
* @brief 所有 xml 节点的基类
*/
class DllExport XmlNode
{
public:
......
#include "khl_xml/khl_xml_document.h"
KHL_XML_NAMESPACE_BEGIN
XmlDocument::XmlDocument()
{
}
XmlDocument::~XmlDocument()
{
}
std::string XmlDocument::LoadFile()
{
return "xml document";
}
KHL_XML_NAMESPACE_END
\ No newline at end of file
......@@ -26,5 +26,8 @@ TEST_CASE("test_003")
spdlog::info("test 003");
auto node = std::make_unique<khl::xml::XmlNode>();
std::cout << node->sayHello() << std::endl;
auto doc = std::make_unique<khl::xml::XmlDocument>();
std::cout << doc->LoadFile() << std::endl;
CHECK("hello khl xml" == node->sayHello());
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册