Commit Graph

90 Commits

Author SHA1 Message Date
6b691f1776 provision for non-blocking comms 2009-08-11 23:08:00 +01:00
12da7f38d8 moved and fixed suspicious test in ISstream::read(word&) 2009-08-11 13:24:34 +02:00
c832d635b1 ISstream::read improvements
- 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
2009-08-11 11:55:46 +02:00
d548839a83 back to the roots with tokenizing numbers
- 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.
2009-08-10 16:10:00 +02:00
8a884892bc version tokenize scalar that stops reading on invalid input 2009-08-10 15:30:48 +02:00
ef37a55f1a improvments to tokenizing Scalar
- avoid other degenerate sequences from being treated as a scalar
  eg, '1-e', '1e+', '1e.2'
2009-08-09 16:16:40 +02:00
9407443e69 improvments to tokenizing Scalar
- 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
2009-08-09 15:43:49 +02:00
e905f9b03f tokenizing Scalar is more stringent
- 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()
2009-08-09 12:43:45 +02:00
31c76da40f Changed the runtime-selection tables to output a sorted toc. 2009-08-06 18:01:28 +01:00
28258d11bd Removed Cint support. 2009-06-23 12:13:33 +01:00
3345fd8378 Removed support for cint. 2009-06-22 21:03:57 +01:00
ac37ed4537 Made floatTransfer 0 by default. 2009-05-05 21:25:01 +01:00
1bc097af33 Convert integers which overflow label to scalar. 2009-04-08 16:54:42 +01:00
b968e62ef9 objectRegistry fixes
- 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
2009-03-06 15:18:00 +01:00
7544164d53 regIOobject, Hasher, IOobject tweak
- 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.
2009-03-05 12:06:57 +01:00
576d9388f0 Preliminary work on hashing
- Hash returns unsigned
- FixedList templated on unsigned int
- include uLabel.H in UList, HashTable etc. so the output function is know
  throughout
2009-02-27 12:40:37 +01:00
28872c4432 moved SHA1::Digest class to SHA1Digest to allow forward declarations 2009-02-11 10:34:45 +01:00
adfd825441 SHA1, dictionary improvements
- added class OSHA1stream for a stream-based calculation method
- dictionary gets digest() method
- dictionaryEntry tweak: avoid trailing space after dictionary keyword
2009-02-11 00:46:01 +01:00
ffd9bb08a8 OSspecific: altered file tests
- 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.
2009-02-06 10:25:41 +01:00
e5c5829244 OSspecific: isDir(), isFile() instead of dir(), file() 2009-02-02 16:50:18 +01:00
ce14f243c6 Removed handling of single-quoted strings. 2009-01-23 15:17:01 +01:00
9087cd7b8e Support for single-quoted strings
- 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()
2009-01-19 11:33:37 +01: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
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
8827ef2bd7 sicortex unaligned access 2009-01-06 19:40:26 +00: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
7467c891bb minor tweak for matching MPI types, documentation cosmetics 2008-12-11 10:12:06 +01:00
7473adc89c writeKeyword spacing for keyType, misc cosmetics changes 2008-12-10 23:00:39 +01:00
bac9f1e1b7 wildcards in dictionaries 2008-10-02 17:28:17 +01:00
318b71e206 Made Matrix generic base-class for SquareMatrix and RectangularMatrix by introducing
the type it will become as a template argument.

Brought everything into line with this change.
2008-09-28 22:50:57 +01:00
2a01530fcf Removed spurious files 2008-07-23 17:54:24 +01:00
02cabc3cf2 updated Copyright (C) \d+-2008 OpenCFD Ltd. 2008-06-25 15:01:46 +02:00
6f62adddd1 find-longlines
* output full file path
  * some preliminary file edits to restore 80-col max.
2008-06-23 17:32:09 +02:00
eb69b16d3e removed old (junk) files
* should gzstream move to ThirdParty?
2008-06-23 14:19:31 +02:00
e5f0dd3e03 Doxygen cleanups
* 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
2008-06-11 10:05:33 +02:00
d325f236b1 Changed Type to Typedef and added Foam:: to the typename in the headers. 2008-06-10 17:03:05 +01:00
cac72ae991 Further changes to remove warnings from gcc-4.3.0. 2008-05-27 16:13:24 +01:00
7faf688709 Initial mattijsLib merge 2008-04-23 12:20:12 +01:00
3170c7c0c9 Creation of OpenFOAM-dev repository 15/04/2008 2008-04-15 18:56:58 +01:00