Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
b5162f91
Commit
b5162f91
authored
6 years ago
by
Mark OLESEN
Browse files
Options
Downloads
Patches
Plain Diff
STYLE: use DynamicList instead of LIFO for managing tags in vtk::formatter
parent
ca5d9123
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/fileFormats/vtk/format/foamVtkFormatter.C
+4
-10
4 additions, 10 deletions
src/fileFormats/vtk/format/foamVtkFormatter.C
src/fileFormats/vtk/format/foamVtkFormatter.H
+7
-8
7 additions, 8 deletions
src/fileFormats/vtk/format/foamVtkFormatter.H
with
11 additions
and
18 deletions
src/fileFormats/vtk/format/foamVtkFormatter.C
+
4
−
10
View file @
b5162f91
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-201
7
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-201
8
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -24,12 +24,6 @@ License
#include
"foamVtkFormatter.H"
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
vtk
::
formatter
::~
formatter
()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
std
::
size_t
Foam
::
vtk
::
formatter
::
encodedLength
(
std
::
size_t
n
)
const
...
...
@@ -95,7 +89,7 @@ Foam::vtk::formatter::openTag(const word& tagName)
indent
();
os_
<<
'<'
<<
tagName
;
xmlTags_
.
push
(
tagName
);
xmlTags_
.
append
(
tagName
);
inTag_
=
true
;
return
*
this
;
...
...
@@ -115,7 +109,7 @@ Foam::vtk::formatter::closeTag(const bool isEmpty)
if
(
isEmpty
)
{
// eg, <tag ... />
xmlTags_
.
pop
();
xmlTags_
.
remove
();
os_
<<
" /"
;
}
os_
<<
'>'
<<
nl
;
...
...
@@ -129,7 +123,7 @@ Foam::vtk::formatter::closeTag(const bool isEmpty)
Foam
::
vtk
::
formatter
&
Foam
::
vtk
::
formatter
::
endTag
(
const
word
&
tagName
)
{
const
word
curr
=
xmlTags_
.
pop
(
);
const
word
curr
(
xmlTags_
.
remove
()
);
indent
();
if
(
inTag_
)
...
...
This diff is collapsed.
Click to expand it.
src/fileFormats/vtk/format/foamVtkFormatter.H
+
7
−
8
View file @
b5162f91
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-201
7
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-201
8
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -43,7 +43,7 @@ SourceFiles
#include
"label.H"
#include
"word.H"
#include
"UList.H"
#include
"
LIFOStack
.H"
#include
"
DynamicList
.H"
#include
"foamVtkCore.H"
#include
"foamVtkPTraits.H"
...
...
@@ -69,8 +69,8 @@ class formatter
//- The output stream for the formatter
std
::
ostream
&
os_
;
//-
S
tack of current XML tags
LIFOStack
<
word
>
xmlTags_
;
//-
LIFO s
tack of current XML tags
DynamicList
<
word
>
xmlTags_
;
//- Tag open/closed/ended state
mutable
bool
inTag_
;
...
...
@@ -104,12 +104,12 @@ public:
//- Destructor
virtual
~
formatter
();
virtual
~
formatter
()
=
default
;
// Member Functions
// Access
// Access
//- Access to the underlying output stream
inline
std
::
ostream
&
os
();
...
...
@@ -142,7 +142,7 @@ public:
// Member Functions
// Output
// Output
//- Indent according to the currently nested XML tags
void
indent
();
...
...
@@ -317,7 +317,6 @@ public:
const
uint64_t
v
,
const
char
quote
=
'\''
);
};
...
...
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