- following Andy's idea to return values as label whenever possible
eg, 1.2e6 -> 1200000
but left it commented out
- avoid buffer overflow in ISstream::read(word&).
Is the 'if (fail())' check itself actually in the correct place??
- other minor cosmetic changes
- since atof is just a call to strtod (in glibc at least), revert to the
original character collection, convert the number via strtod/strtol and
check the end pointer so see if everything was converted. Flag both bad
formats (eg, ".e") and trailing junk (eg, "1.e4e") as a tokenize error.
These were previously silently ignored.
- simple (same weight as before), but with trivial error checking.
Retain buffer overflow check.
- for alphanumeric sequences (optionally with [-+.]) that don't look
like a float or int -> return as a word
This means that '0patch' now looks like a <word> (not <label>)
and '1.end' looks like a <word> and not <scalar>
Something like '1-e' still does get treated as a bad <scalar> though
- require a digit somewhere. This traps '.' or '.+E' type of sequences
instead of returning them as 0
- avoid buffer overruns on really long sequences
- should we be considering strtod() as an alternative to atof() and checking
the errno?
The same might be true for using strtoul() or strtol() instead of atol()
- objectRegistry gets a rename() that also adjusts the dbDir
- cloud reworked to use static variables subInstance and defaultName.
This avoids writing "lagrangian" everywhere
string fixes
- avoid masking of std::string::replace in string.H
- avoid old strstream in PV3FoamReader
- regIOobject: don't re-register an unregister object on rename/assignment
- Hasher: split-off HasherInt with uint32_t specializations
- IOobject: writeBanner/writeDivider return Stream for easier chaining.
... also dropped some namespace bracketing while I was at it.
- added class OSHA1stream for a stream-based calculation method
- dictionary gets digest() method
- dictionaryEntry tweak: avoid trailing space after dictionary keyword
- removed the previously added fileName type(), isDir(), isFile() methods.
- added optional bool parameter to isFile() function to explicitly
enable/disable the check for gzip files.
- fixed minor bugginess where the default usage of isFile() would result in
false positive matches.
- be slightly more stringent and use isDir() and isFile() instead of
exists() function when we actually know the expected type.
- token class handles both single and double quoted strings. Single quoted
strings are used to tag regular expressions. At the moment this is just
syntactical sugar and isn't (yet) treated differently than double-quoted
strings.
- write output for std:string, with/without single quotes with the method
writeQuoted(). Use distinct method name to avoid inadvertent compiler
conversions.
- write wordRe and keyType using writeQuoted()
- can use 'XX.empty()' instead of 'XX.size() == 0', 'XX.size() < 1' or
'XX.size() <= 0' or for simpler coding.
It also has the same number of characters as '!XX.size()' and /might/ be
more readable
- many size checking had 'XX.size() > 0', 'XX.size() != 0', or 'XX.size() >= 1'
when a simple 'XX.size()' suffices
- Istream and Ostream now retain backslashes when reading/writing strings.
The previous implementation simply discarded them, except when used to
escape a double-quote or a newline. It is now vitally important to retain
them, eg for quoting regular expression meta-characters.
The backslash continues to be used as an escape character for double-quote
and newline, but otherwise get passed through "as-is" without any other
special meaning (ie, they are *NOT* C-style strings). This helps avoid
'backslash hell'!
For example,
string: "match real dots \.+, question mark \? or any char .*"
C-style: "match real dots \\.+, question mark \\? or any char .*"
- combined subfiles in db/IOstreams, some had more copyright info than code
- OPstreamI.H contained only private methods, moved into OPstream.C
Are these really correct?
IOstreams/Istream.H:# include "HashTable.C"
token/token.H:#define NoHashTableC
* skip doxygen docs for local variables (treeBoundBox)
* filter transforms 'Typedef' -> @typedef
* added tools/find-retagged
* manually changed some InClass tags to Typedef - still needs more attention