- Dec 13, 2019
-
-
Mark OLESEN authored
- finds beg/end indices of string trimmed of leading/trailing whitespace
-
Mark OLESEN authored
This reverts commit 677e3142.
-
Mark OLESEN authored
-
- Dec 09, 2019
-
-
Mark OLESEN authored
- replace stringOps::toScalar with a more generic stringOps::evaluate method that handles scalars, vectors etc. - improve #eval to handle various mathematical operations. Previously only handled scalars. Now produce vectors, tensors etc for the entries. These tokens are streamed directly into the entry.
-
- Oct 31, 2019
-
-
OpenFOAM bot authored
-
- Nov 10, 2019
-
-
Mark OLESEN authored
- move left/right positions prior to substr
-
- Oct 07, 2019
-
-
Mark OLESEN authored
- add toScalar evaluation, embedded as "${{EXPR}}". For example, "repeat ${{5 * 7}} times or ${{ pow(3, 10) }}" - use direct string concatenation if primitive entry is only a string type. This prevents spurious quotes from appearing in the expansion. radius "(2+4)"; angle "3*15"; #eval "$radius*sin(degToRad($angle))"; We want to have '(2+4)*sin(degToRad(3*15))' and not '"(2+4)"*sin(degToRad("3*15"))' ENH: code refactoring - refactored expansion code with low-level service routines now belonging to file-scope. All expansion routines use a common multi-parameter backend to handle with/without dictionary etc. This removes a large amount of code duplication.
-
- Sep 30, 2019
-
-
Mark OLESEN authored
- the #eval directive is similar to the #calc directive, but for evaluating string expressions into scalar values. It uses an internal parser for the evaluation instead of dynamic code compilation. This can make it more suitable for 'quick' evaluations. The evaluation supports the following: - operations: - + * / - functions: exp, log, log10, pow, sqrt, cbrt, sqr, mag, magSqr - trigonometric: sin, cos, tan, asin, acos, atan, atan2, hypot - hyperbolic: sinh, cosh, tanh - conversions: degToRad, radToDeg - constants: pi() - misc: rand(), rand(seed)
-
- Sep 24, 2019
-
-
Mark OLESEN authored
- useful for manual handling of string with comments
-
- Aug 07, 2019
-
-
Mark OLESEN authored
-
- Feb 06, 2019
-
-
OpenFOAM bot authored
-
- Dec 13, 2018
-
-
Mark OLESEN authored
- now use findEtcEntry() instead to handle file or directory. Added findEtcEntries(), which provides provides a common code basis for findEtcDirs(), findEtcFiles() ...
-
- Dec 12, 2018
-
-
Mark OLESEN authored
- similar to the foamEtcFile script -mode=... option, the specific search location (user/group/other) can now also specified for string expansions and as a numerical value for etcFile() For example, if searching for group or other (project) controlDict, but not wishing to see the user controlDict: 1. foamEtcFile -mode=go controlDict 2. fileName dictFile("<etc:go>/controlDict"); dictFile.expand(); 3. etcFile(controlDict, false, 0077); The default behaviour for searching all contexts is unchanged. 1. foamEtcFile controlDict 2. fileName dictFile("<etc>/controlDict"); dictFile.expand(); 3. etcFile(controlDict);
-
- Nov 23, 2018
-
-
Mark OLESEN authored
- Within strings it is preferable to use the "<etc>" instead. Most use cases for the old "~OpenFOAM" expansion have been obsoleted by the #includeEtc directive.
-
- Nov 21, 2018
-
-
Mark OLESEN authored
- generalize output text wrapping, use for usage notes - add -help-man option for generating manpage content for any OpenFOAM application or solver. bin/tools/foamCreateManpage as helper
-
- Sep 11, 2018
-
-
Andrew Heather authored
-
- Mar 28, 2018
-
-
Andrew Heather authored
-
- Apr 10, 2018
-
-
Mark OLESEN authored
Support the following expansions when they occur at the start of a string: Short-form Equivalent ========= =========== <etc>/ ~OpenFOAM/ (as per foamEtcFile) <case>/ $FOAM_CASE/ <constant>/ $FOAM_CASE/constant/ <system>/ $FOAM_CASE/system/ These can be used in fileName expansions to improve clarity and reduce some typing "<constant>/reactions" vs "$FOAM_CASE/constant/reactions"
-
- Feb 21, 2018
-
-
Mark OLESEN authored
- this permits direct storage of a list with additional matcher capabilities - provide wordRes::matcher class for similar behaviour as previously
-
- Feb 08, 2018
-
-
Mark OLESEN authored
- reduces some ambiguity and clarifies the expected output and behaviour. STYLE: reduce some automatic conversions of char to string
-
- Nov 13, 2017
-
-
Mark OLESEN authored
- reduces ambiguity between matching a list of strings and a single string.
-
- Nov 05, 2017
-
-
Mark OLESEN authored
- move append() single element to List and DynamicList ENH: add stringOps::count to avoid unnecessary string conversions
-
- Nov 23, 2017
-
-
Mark OLESEN authored
- split now optionally retains empty substrings. Added split on fixed field width. - Foam::name() now formats directly into string buffer, which a removes one layer of copying and also avoids using a non-constexpr in the temporary. STYLE: explicit type narrowing on zero-padded output for ensight
-
- Nov 22, 2017
-
-
Mark OLESEN authored
- this makes them applicable to Foam::string, Foam::word etc ENH: improvements to CStringList - add strings() sublist variant which can be useful when handling command arguments separately - add construct from SubStrings.
-
- Nov 20, 2017
-
-
Mark OLESEN authored
- eliminates previous code duplication and improves maintainability
-
- Aug 14, 2017
-
-
Mark OLESEN authored
- assists when building simple hand-rolled parsers. Also add string::split() taking a sub-string for the delimiter.
-
- Oct 27, 2017
-
-
Mark OLESEN authored
- this increases the flexibility of the interface - Add stringOps 'natural' string sorting comparison. Digits are sorted in their natural order, which means that (file10.txt file05.txt file2.txt) are sorted as (file2.txt file05.txt file10.txt) STYLE: consistent naming of template parameters for comparators - Compare for normal binary predicates - ListComparePredicate for list compare binary predicates
-
- Jul 20, 2017
-
-
Mark OLESEN authored
- generic means of holding ranges of substring iterators
-
- Feb 24, 2017
-
-
Mark Olesen authored
- was previously only within string expansions, but cover dictionaries as well for consistency ENH: replace the never-used fileName::caseName() functionality - stringOps::inplaceReplaceVar() is more general stringOps::inplaceReplaceVar(myfile, "FOAM_CASE"); STYLE: relax parameter passing when calling some POSIX 'query' functions. - A std::string is sufficient since the functions use a plain C-string. Eg, getEnv("SOMETHING"). Retain more stringent Foam::word for things like setEnv, since this could be useful.
-
- Jul 01, 2016
-
-
Mark Olesen authored
- there are some cases in which the C-style sprintf is much more convenient, albeit problematic for buffer overwrites. Provide a formatting version of Foam::name() for language primitives that is buffer-safe. Returns a Foam::word, so that further output will be unquoted, but without any checking that the characters are indeed entirely valid word characters. Example use, i = 1234; s = Foam::name("%08d", i); produces '00001234' Alternative using string streams: std::ostringstream buf; buf.fill('0'); buf << setw(8) << i; s = buf.str(); Note that the format specification can also be slightly more complex: Foam::name("output%08d.vtk", i); Foam::name("timing=%.2fs", time); It remains the caller's responsibility to ensure that the format mask is valid.
-
- Oct 12, 2012
-
-
mattijs authored
-
- Aug 14, 2011
-
-
Henry authored
-
- Mar 18, 2011
-
-
Mark Olesen authored
- syntax as per Bourne/Korn shell ${parameter:+altValue} If parameter is unset or null, nothing is substituted. Otherwise the \c altValue is substituted.
-
- Mar 02, 2011
-
-
Mark Olesen authored
- syntax as per Bourne/Korn shell ${parameter:-defValue} If parameter is unset or null, the \c defValue is substituted. Otherwise, the value of parameter is substituted.
-
- Feb 23, 2011
-
-
Mark Olesen authored
-
Mark Olesen authored
-
Mark Olesen authored
-
- Feb 22, 2011
-
-
Mark Olesen authored
-