Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
ce14f243
Commit
ce14f243
authored
Jan 23, 2009
by
Mark Olesen
Browse files
Removed handling of single-quoted strings.
parent
42c04b85
Changes
12
Hide whitespace changes
Inline
Side-by-side
applications/test/dictionary/testDictRegex
View file @
ce14f243
...
...
@@ -15,21 +15,21 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#inputMode merge
'
.*
'
parentValue1;
'
[n-z].*
'
parentValue2;
'
f.*
'
parentValue3;
"
.*
"
parentValue1;
"
[n-z].*
"
parentValue2;
"
f.*
"
parentValue3;
keyX parentValue4;
keyY parentValue5;
'
(.*)Dict
'
"
(.*)Dict
"
{
foo subdictValue0;
bar $f.*; // should this really match 'foo'?
// result is dependent on insert order!
'
a.*c
'
subdictValue3;
'
ab.*
'
subdictValue2;
'
a.*
'
subdictValue1;
"
a.*c
"
subdictValue3;
"
ab.*
"
subdictValue2;
"
a.*
"
subdictValue1;
abcd \1;
}
...
...
applications/utilities/mesh/manipulation/cellSet/cellSetDict
View file @
ce14f243
...
...
@@ -82,7 +82,7 @@ topoSetSources
// Cells in cell zone
zoneToCell
{
name
'
.*Zone
'
; // Name of cellZone, regular expressions allowed
name
"
.*Zone
"
; // Name of cellZone, regular expressions allowed
}
// values of field within certain range
...
...
applications/utilities/mesh/manipulation/faceSet/faceSetDict
View file @
ce14f243
...
...
@@ -56,13 +56,13 @@ topoSetSources
// All faces of patch
patchToFace
{
name
'
.*Wall
'
; // Name of patch, regular expressions allowed
name
"
.*Wall
"
; // Name of patch, regular expressions allowed
}
// All faces of faceZone
zoneToFace
{
name
'
.*Zone1
'
; // Name of faceZone, regular expressions allowed
name
"
.*Zone1
"
; // Name of faceZone, regular expressions allowed
}
// Faces with face centre within box
...
...
applications/utilities/mesh/manipulation/pointSet/pointSetDict
View file @
ce14f243
...
...
@@ -60,7 +60,7 @@ topoSetSources
// All points in pointzone
zoneToPoint
{
name
'
.*Zone
'
; // name of pointZone, regular expressions allowed
name
"
.*Zone
"
; // name of pointZone, regular expressions allowed
}
// Select based on surface
...
...
src/OpenFOAM/db/IOstreams/IOstreams/Ostream.C
View file @
ce14f243
...
...
@@ -48,7 +48,7 @@ void Foam::Ostream::decrIndent()
// Write keyType
// write regular expression as
single-
quoted string
// write regular expression as quoted string
// write plain word as word (unquoted)
Foam
::
Ostream
&
Foam
::
Ostream
::
write
(
const
keyType
&
kw
)
{
...
...
src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H
View file @
ce14f243
...
...
@@ -115,7 +115,7 @@ public:
//- Write string
virtual
Ostream
&
write
(
const
string
&
)
=
0
;
//- Write std::string surrounded by
single
quotes.
//- Write std::string surrounded by quotes.
// Optional write without quotes.
virtual
Ostream
&
writeQuoted
(
...
...
src/OpenFOAM/db/IOstreams/Pstreams/OPstream.H
View file @
ce14f243
...
...
@@ -136,7 +136,7 @@ public:
//- Write string
Ostream
&
write
(
const
string
&
);
//- Write std::string surrounded by
single
quotes.
//- Write std::string surrounded by quotes.
// Optional write without quotes.
Ostream
&
writeQuoted
(
...
...
src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C
View file @
ce14f243
...
...
@@ -152,9 +152,8 @@ Foam::Istream& Foam::ISstream::read(token& t)
return
*
this
;
}
// Strings: enclosed by
single or
double quotes.
// Strings: enclosed by double quotes.
case
token
:
:
BEGIN_STRING
:
case
token
:
:
BEGIN_QSTRING
:
{
putback
(
c
);
string
*
sPtr
=
new
string
;
...
...
@@ -369,11 +368,8 @@ Foam::Istream& Foam::ISstream::read(string& str)
char
endTok
=
token
::
END_STRING
;
if
(
c
==
token
::
BEGIN_QSTRING
)
{
endTok
=
token
::
END_QSTRING
;
}
else
if
(
c
!=
token
::
BEGIN_STRING
)
// Note, we could also handle single-quoted strings here (if desired)
if
(
c
!=
token
::
BEGIN_STRING
)
{
buf
[
0
]
=
'\0'
;
...
...
src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C
View file @
ce14f243
...
...
@@ -118,7 +118,7 @@ Foam::Ostream& Foam::OSstream::writeQuoted
{
if
(
quoted
)
{
os_
<<
token
::
BEGIN_
Q
STRING
;
os_
<<
token
::
BEGIN_STRING
;
register
int
backslash
=
0
;
for
...
...
@@ -141,7 +141,7 @@ Foam::Ostream& Foam::OSstream::writeQuoted
lineNumber_
++
;
backslash
++
;
// backslash escape for newline
}
else
if
(
c
==
token
::
END_
Q
STRING
)
else
if
(
c
==
token
::
END_STRING
)
{
backslash
++
;
// backslash escape for quote
}
...
...
@@ -158,7 +158,7 @@ Foam::Ostream& Foam::OSstream::writeQuoted
// silently drop any trailing backslashes
// they would otherwise appear like an escaped end-quote
os_
<<
token
::
END_
Q
STRING
;
os_
<<
token
::
END_STRING
;
}
else
{
...
...
src/OpenFOAM/db/IOstreams/Sstreams/OSstream.H
View file @
ce14f243
...
...
@@ -141,7 +141,7 @@ public:
// double-quote.
virtual
Ostream
&
write
(
const
string
&
);
//- Write std::string surrounded by
single
quotes.
//- Write std::string surrounded by quotes.
// Optional write without quotes.
virtual
Ostream
&
writeQuoted
(
...
...
src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.H
View file @
ce14f243
...
...
@@ -114,8 +114,8 @@ public:
//- Write string
virtual
Ostream
&
write
(
const
string
&
);
//- Write std::string
//
Specify if string should be single quoted or remain un
quote
d
.
//- Write std::string
surrounded by quotes.
//
Optional write without
quote
s
.
virtual
Ostream
&
writeQuoted
(
const
std
::
string
&
,
...
...
src/OpenFOAM/db/IOstreams/token/token.H
View file @
ce14f243
...
...
@@ -109,8 +109,6 @@ public:
BEGIN_STRING
=
'"'
,
END_STRING
=
BEGIN_STRING
,
BEGIN_QSTRING
=
'\''
,
END_QSTRING
=
BEGIN_QSTRING
,
ASSIGN
=
'='
,
ADD
=
'+'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment