git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert some tests from TUT to Boost.Test
[stg.git]
/
projects
/
stargazer
/
plugins
/
configuration
/
sgconfig
/
parser.h
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/parser.h
b/projects/stargazer/plugins/configuration/sgconfig/parser.h
index 4e4b94173c2beb8f4d61a522550390532b487245..5dd339bd7b0e49b4ed51f87ba7761ebb5824a7d1 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/parser.h
+++ b/
projects/stargazer/plugins/configuration/sgconfig/parser.h
@@
-18,28
+18,30
@@
* Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
*/
* Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
*/
-#ifndef PARSER_H
-#define PARSER_H
+#pragma once
#include <string>
#include <map>
#include <string>
#include <map>
-class ADMIN;
+namespace STG
+{
+struct Admin;
+}
class BASE_PARSER
{
public:
struct FACTORY
{
class BASE_PARSER
{
public:
struct FACTORY
{
- virtual BASE_PARSER * create(const ADMIN & admin) = 0;
+ virtual ~FACTORY() {}
+ virtual BASE_PARSER * create(const STG::Admin & admin) = 0;
};
typedef std::map<std::string, FACTORY *> REGISTRY;
};
typedef std::map<std::string, FACTORY *> REGISTRY;
- BASE_PARSER(const
ADMIN
& admin, const std::string & t)
+ BASE_PARSER(const
STG::Admin
& admin, const std::string & t)
: m_currAdmin(admin),
m_depth(0),
: m_currAdmin(admin),
m_depth(0),
- m_tag(t),
- m_done(false)
+ m_tag(t)
{}
virtual ~BASE_PARSER() {}
virtual int Start(void * data, const char * el, const char ** attr);
{}
virtual ~BASE_PARSER() {}
virtual int Start(void * data, const char * el, const char ** attr);
@@
-50,20
+52,15
@@
class BASE_PARSER
std::string GetOpenTag() const { return "<" + m_tag + ">"; }
std::string GetCloseTag() const { return "</" + m_tag + ">"; }
std::string GetOpenTag() const { return "<" + m_tag + ">"; }
std::string GetCloseTag() const { return "</" + m_tag + ">"; }
- bool IsDone() const { return m_done; }
-
protected:
BASE_PARSER(const BASE_PARSER & rvalue);
BASE_PARSER & operator=(const BASE_PARSER & rvalue);
protected:
BASE_PARSER(const BASE_PARSER & rvalue);
BASE_PARSER & operator=(const BASE_PARSER & rvalue);
- const
ADMIN
& m_currAdmin;
+ const
STG::Admin
& m_currAdmin;
size_t m_depth;
std::string m_answer;
std::string m_tag;
size_t m_depth;
std::string m_answer;
std::string m_tag;
- bool m_done;
private:
virtual void CreateAnswer() = 0;
};
private:
virtual void CreateAnswer() = 0;
};
-
-#endif //PARSER_H