Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GeoModelTools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
GeoModelDev
GeoModelTools
Commits
895263e5
Commit
895263e5
authored
5 years ago
by
Andrea Dell'Acqua
Browse files
Options
Downloads
Patches
Plain Diff
add post handling virtual method
parent
1dd75211
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#1722532
passed
5 years ago
Stage: dependencies
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GeoModelXMLParser/GeoModelXMLParser/XMLHandler.h
+16
-14
16 additions, 14 deletions
GeoModelXMLParser/GeoModelXMLParser/XMLHandler.h
GeoModelXMLParser/src/XercesParser.cxx
+6
-5
6 additions, 5 deletions
GeoModelXMLParser/src/XercesParser.cxx
with
22 additions
and
19 deletions
GeoModelXMLParser/GeoModelXMLParser/XMLHandler.h
+
16
−
14
View file @
895263e5
...
...
@@ -6,6 +6,7 @@
#define XMLHandler_H
#include
<string>
#include
<iostream>
#include
<xercesc/dom/DOM.hpp>
#include
"ExpressionEvaluator/ExpressionEvaluator.h"
...
...
@@ -18,13 +19,14 @@ public:
virtual
~
XMLHandler
()
{}
std
::
string
GetName
()
{
return
m_name
;}
virtual
void
ElementHandle
()
=
0
;
virtual
void
Handle
(
xercesc
::
DOMNode
*
t
)
virtual
void
Handle
(
xercesc
::
DOMNode
*
t
)
{
SetCurrentElement
(
t
);
ElementHandle
();
}
void
StopLoop
(
bool
);
bool
IsLoopToBeStopped
();
virtual
void
postLoopHandling
()
{;}
protected
:
std
::
string
m_name
;
bool
m_stopLoop
;
...
...
@@ -32,32 +34,32 @@ protected:
static
xercesc
::
DOMNode
*
s_currentElement
;
static
void
SetCurrentElement
(
xercesc
::
DOMNode
*
t
)
{
s_currentElement
=
t
;}
static
xercesc
::
DOMNode
*
GetCurrentElement
()
{
return
s_currentElement
;}
bool
isAttribute
(
const
std
::
string
)
const
;
std
::
string
getAttribute
(
const
std
::
string
,
bool
&
)
const
;
std
::
string
getAttributeAsString
(
const
std
::
string
)
const
;
double
getAttributeAsDouble
(
const
std
::
string
)
const
;
int
getAttributeAsInt
(
const
std
::
string
)
const
;
std
::
vector
<
double
>
getAttributeAsVector
(
const
std
::
string
)
const
;
std
::
string
getAttributeAsString
(
const
std
::
string
)
const
;
double
getAttributeAsDouble
(
const
std
::
string
)
const
;
int
getAttributeAsInt
(
const
std
::
string
)
const
;
std
::
vector
<
double
>
getAttributeAsVector
(
const
std
::
string
)
const
;
std
::
vector
<
int
>
getAttributeAsIntVector
(
const
std
::
string
)
const
;
std
::
string
getAttributeAsString
(
const
std
::
string
,
bool
&
)
const
;
double
getAttributeAsDouble
(
const
std
::
string
,
bool
&
)
const
;
int
getAttributeAsInt
(
const
std
::
string
,
bool
&
)
const
;
std
::
vector
<
double
>
getAttributeAsVector
(
const
std
::
string
,
bool
&
)
const
;
std
::
vector
<
int
>
getAttributeAsIntVector
(
const
std
::
string
,
bool
&
)
const
;
std
::
vector
<
int
>
getAttributeAsIntVector
(
const
std
::
string
,
bool
&
)
const
;
std
::
string
getAttributeAsString
(
const
std
::
string
,
const
std
::
string
)
const
;
double
getAttributeAsDouble
(
const
std
::
string
,
const
double
)
const
;
int
getAttributeAsInt
(
const
std
::
string
,
const
int
)
const
;
std
::
vector
<
double
>
getAttributeAsVector
(
const
std
::
string
,
const
std
::
vector
<
double
>
)
const
;
std
::
vector
<
int
>
getAttributeAsIntVector
(
const
std
::
string
,
const
std
::
vector
<
int
>
)
const
;
std
::
vector
<
int
>
getAttributeAsIntVector
(
const
std
::
string
,
const
std
::
vector
<
int
>
)
const
;
static
bool
s_printFlag
;
ExpressionEvaluator
*
Evaluator
()
const
{
static
ExpressionEvaluator
*
eval
=
ExpressionEvaluator
::
GetEvaluator
();
return
eval
;
}
ExpressionEvaluator
*
Evaluator
()
const
{
static
ExpressionEvaluator
*
eval
=
ExpressionEvaluator
::
GetEvaluator
();
return
eval
;
}
private
:
void
RegisterToStore
();
};
...
...
This diff is collapsed.
Click to expand it.
GeoModelXMLParser/src/XercesParser.cxx
+
6
−
5
View file @
895263e5
...
...
@@ -90,7 +90,7 @@ bool XercesParser::ParseFile(std::string s)
{
XERCES_STD_QUALIFIER
cerr
<<
"An error occurred during parsing
\n
"
<<
XERCES_STD_QUALIFIER
endl
;
errorsOccured
=
true
;
}
}
m_doc
=
m_parser
->
getDocument
();
return
errorsOccured
;
}
...
...
@@ -148,7 +148,7 @@ bool XercesParser::ParseString(std::string s)
{
XERCES_STD_QUALIFIER
cerr
<<
"An error occurred during parsing
\n
"
<<
XERCES_STD_QUALIFIER
endl
;
errorsOccured
=
true
;
}
}
m_doc
=
m_parser
->
getDocument
();
return
errorsOccured
;
}
...
...
@@ -187,7 +187,7 @@ bool XercesParser::WriteToFile(std::string s)
void
XercesParser
::
navigateTree
()
{
if
(
!
m_doc
)
if
(
!
m_doc
)
{
std
::
cout
<<
" something is wrong! no document set!"
<<
std
::
endl
;
std
::
cout
<<
" doing nothing!"
<<
std
::
endl
;
...
...
@@ -235,6 +235,7 @@ void XercesParser::elementLoop(DOMNode *e)
elementLoop
(
child
);
}
}
if
(
h
)
h
->
postLoopHandling
();
}
// XMLHandler *h=XMLHandlerStore::GetHandlerStore()->GetHandler(element);
// bool stopLoop=false;
...
...
@@ -245,8 +246,8 @@ void XercesParser::elementLoop(DOMNode *e)
// }
// TiXmlElement* subelement;
// subelement=element->FirstChildElement();
//
// if (!stopLoop && subelement)
//
// if (!stopLoop && subelement)
// do
// {
// // std::cout<<" \telement "<<subelement->Value()<<std::endl;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment