Commit Graph

28 Commits

Author SHA1 Message Date
3adf0f5c8e minor cleanup for reverted string changes (commit 4f5f66e759)
- put back debug switch (even although it is never used)
- remove stringsGlobals.C, since it is now never used
2009-01-16 12:27:03 +01:00
4395170915 Put back
static const char* const typeName;
        static int debug;

which had disappeared.
2009-01-15 16:57:01 +00:00
bd04dc7b59 Some stuff 2009-01-15 16:45:44 +00:00
4f5f66e759 Reverted change concerning the location of the construction of the "null" strings.
Changed dotFoam function to use null-constructed strings rather that the "null" strings.
2009-01-15 16:41:08 +00:00
95dcb6ded7 Simplify checking of container (List/HashTable, strings) sizes
- 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
2009-01-10 20:28:06 +01:00
b85c9a7487 avoided some unneeded conversions of string::npos, minor cleanup of className
- string doesn't use any debug info, remove it
- restructured the macros to add in NoDebug macro versions to className,
  typeInfo.  Might be helpful with tackling the globals bootstrapping issue.
- HashTableName + StaticHashTableName - avoid lookup of debug switch when
  FULLDEBUG is not defined
2009-01-09 15:15:21 +01:00
c5b38a7232 update copyrights for 2009 2008-12-31 19:01:56 +01:00
cdd2266467 Merge commit 'OpenCFD/master' into olesenm
Conflicts:

	src/OpenFOAM/db/IOstreams/Pstreams/IPstream.C
	src/OpenFOAM/db/IOstreams/Pstreams/OPstream.C
2009-01-07 09:39:17 +01:00
3c5852ebfc reworked regExp + wordRe a bit, minor change to keyType
regExp:
- added optional ignoreCase for constructor.
- the compile() methods is now exposed as set(...) method with an optional
  ignoreCase argument.  Not currently much use for the other regex compile
  flags though. The set() method can be used directly instead of the
  operator=() assignment.

keyType + wordRe:
- it's not clear that any particular characters are valid/invalid (compared
  to string or word), so just drop the valid(char) method for now

wordRe:
- a bool doesn't suffice, added enum compOption (compile-option)
- most constructors now have a compOption. In *all* cases it defaults to
  LITERAL - ie, the same behaviour for std::string and Foam::string
- added set(...) methods that do much the same as operator=(...), but the
  compOption can be specified.  In all cases, it defaults to DETECT.

 In Summary
    By default the constructors will generally preserve the argument as
    string literal and the assignment operators will use the wordRe::DETECT
    compOption to scan the string for regular expression meta characters
    and/or invalid word characters and react accordingly.

    The exceptions are when constructing/assigning from another
    Foam::wordRe (preserve the same type) or from a Foam::word (always
    literal).
2009-01-05 17:02:58 +01:00
2717aa5c7d new wordRe class - a word that holds a regExp
- a possible future replacement for keyType, but the immediate use is the
    wordReList for grepping through other lists.
  - note that the argList treatment of '(' ... ')' yields quoted strings,
    which we can use for building a wordReList

minor cleanup of regExp class

  - constructor from std::string, match std::string and
    operator=(std::string&)
    rely on automatic conversion to Foam::string
  - ditch partialMatch with sub-groups, it doesn't make much sense
2009-01-04 00:33:27 +01:00
1d866d7fe8 reworked IOstreams
- 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
2009-01-03 12:52:27 +01:00
28b200bcd9 update copyrights for 2009 2008-12-31 19:01:56 +01:00
1089d5a5d5 Moved the construction of the static "null" strings to stringsGlobals.C which is included in global.Cver to avoid inter-dependency problems in the construction of globals.
Patch supplied by Michael Wild, see
http://openfoam.cfd-online.com/cgi-bin/forum/show.cgi?126/10442
2008-12-29 18:54:46 +00:00
eb37259958 Changed the "unsigned int" old-style cast to a "unsigned" type conversion to avoid
warning: use of old-style cast
2008-12-29 18:51:40 +00:00
0571f5393e rename Foam::dotFoam() -> Foam::findEtcFile() with an optional 'mandatory' argument
- if mandatory is true, findEtcFile() will abort with a message (via cerr).
  This allows a non-existent file to be caught at the lowest level and avoid
  error handling in IFstream, which might not be initialized at that stage.
2008-12-12 19:16:32 +01:00
cc571ba111 removed last bits of wildcard vs. pattern 2008-12-12 09:48:25 +01:00
7473adc89c writeKeyword spacing for keyType, misc cosmetics changes 2008-12-10 23:00:39 +01:00
0f579e4073 wildcards in dictionaries 2008-10-02 17:28:33 +01:00
bac9f1e1b7 wildcards in dictionaries 2008-10-02 17:28:17 +01:00
b42e13583a More cleanup on headers/source for doxygen
- it also found things like size_t instead of size_type in fileName class
2008-07-22 11:12:40 +02:00
02cabc3cf2 updated Copyright (C) \d+-2008 OpenCFD Ltd. 2008-06-25 15:01:46 +02:00
0cbbefb3a6 Revert string expansion of leading '.' and './' to the original behaviour.
* Now that the expansion of FOAM_CASE is delayed in the boundary conditions,
  the old expansion is simpler and seems to work better with IOobjects.
2008-06-10 10:23:14 +02:00
0b9c6cace3 Merge commit 'origin/master' into olesenm 2008-05-27 09:57:59 +02:00
0f687ccd76 Minimum changes to compile everything with gcc-4.3.0 2008-05-26 19:27:23 +01:00
4a2a23a710 Lots of changes from Mark and my changes to ddtPhiCorr all mixed together
because I failed to work out how to merge Mark's stuff -- HELP!!!
2008-05-25 21:46:37 +01:00
d03b912538 Improved string expansion handling.
* delay fileName expansion in timeVarying BCs, add the possibility to use
relative directories
* export FOAM_ROOT from argList: "." and ".." for serial/parallel. This
allows us to specify a single movable location regardless of serial/parallel.
* only replace an isolated leading "./" with CWD, strip others. This
improves use for a relative names.
2008-05-23 14:03:16 +02:00
02df4dbd2c add copy construct with max number of characters 2008-05-08 14:17:04 +02:00
3170c7c0c9 Creation of OpenFOAM-dev repository 15/04/2008 2008-04-15 18:56:58 +01:00