Commit Graph

20 Commits

Author SHA1 Message Date
Mark Olesen
96a1b86fb9 ENH: consistency improvements for keyType and wordRe
- simplify compile/uncompile, reading, assignment

- implicit construct wordRe from keyType (was explicit) to simplify
  future API changes.

- make Foam::isspace consistent with std::isspace (C-locale)
  by including vertical tab and form feed

ENH: improve #ifeq float/label comparisons
2021-04-19 16:33:42 +00:00
Mark Olesen
79048eb68f STYLE: use writeEntry(), beginBlock(), endBlock() methods
- use dictionary::get<..> instead of lookup in a few more places
2020-04-28 10:41:23 +02:00
Andrew Heather
fdf8d10ab4 Merge commit 'e9219558d7' into develop-v1906 2019-12-05 11:47:19 +00:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
Mark Olesen
b5342c166c ENH: handle keyType type (literal/regex) as enum instead of bool
- makes its use somewhat clearer and allows more future options
2019-08-20 13:48:05 +02:00
Mark Olesen
95a33c2f68 ENH: wordRes::uniq() removes all duplicates
- previously just removed duplicate literals, but now remove any
  duplicates.

- Replace previous wordHashSet implementation with a linear search
  instead. The lists are normally fairly small and mostly just have
  unique entries anyhow. This reduces the overall overhead.
2019-02-14 11:03:04 +01:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
3b77493abc ENH: wordRes matcher method that distinguishes literal vs. regex
- useful for customizing the behaviour of white/black lists depending
  on the type of the match.
2018-10-07 18:30:33 +02:00
Mark Olesen
a8da75d27e STYLE: support wordRe ICASE enum
- better naming consistency with std::regex_constants::icase

- deprecate older NOCASE, but leave supported
2018-04-13 10:42:42 +02:00
Mark Olesen
c126464d1c ENH: change wordRes to be a List of wordRe instead of a wrapper (issue #259)
- this permits direct storage of a list with additional matcher
  capabilities

- provide wordRes::matcher class for similar behaviour as previously
2018-02-21 10:05:30 +01:00
Mark Olesen
e1b71c028c ENH: add move/swap semantics to string types and regExp
- move append() single element to List and DynamicList

ENH: add stringOps::count to avoid unnecessary string conversions
2017-11-05 13:26:10 +01:00
Mark Olesen
8d018e7950 ENH: added constant predicates
- predicates::always and predicates::never returning true and false,
  respectively. These simple classes make it easier when writing
  templated code.

  As well as unary and binary predicate forms, they also contain a
  match(std::string) method for compatibility with regex-based classes.

STYLE: write bool and direction as primitive 'int' not as 'label'.
2017-05-17 10:18:14 +02:00
Mark Olesen
a8d2ebf298 ENH: cleanup wordRe interfaces etc.
- ensure that the string-related classes have consistently similar
  matching methods. Use operator()(const std::string) as an entry
  point for the match() method, which makes it easier to use for
  filters and predicates. In some cases this will also permit using
  a HashSet as a match predicate.

regExp
====
- the set method now returns a bool to signal that the requested
  pattern was compiled.

wordRe
====
- have separate constructors with the compilation option (was previously
  a default parameter). This leaves the single parameter constructor
  explicit, but the two parameter version is now non-explicit, which
  makes it easier to use when building lists.

- renamed compile-option from REGEX (to REGEXP) for consistency with
  with the <regex.h>, <regex> header names etc.

wordRes
====
- renamed from wordReListMatcher -> wordRes. For reduced typing and
  since it behaves as an entity only slightly related to its underlying
  list nature.

- Provide old name as typedef and include for code transition.

- pass through some list methods into wordRes

hashedWordList
====
- hashedWordList[const word& name] now returns a -1 if the name is is
  not found in the list of indices. That has been a pending change
  ever since hashedWordList was generalized out of speciesTable
  (Oct-2010).

- add operator()(const word& name) for easy use as a predicate

STYLE: adjust parameter names in stringListOps

- reflect if the parameter is being used as a primary matcher, or the
  matcher will be derived from the parameter.
  For example,
      (const char* re), which first creates a regExp
      versus (const regExp& matcher) which is used directly.
2017-05-16 23:54:43 +02:00
Mark Olesen
215349aa69 BUG: in wordRe::operator=(const keyType&)
- the regex was not being unset on assignment.
- drop unused recompile() method as being dubious
2017-03-10 13:05:35 +01:00
Henry Weller
56fa7c0906 Update code to use the simpler C++11 template syntax removing spaces between closing ">"s 2016-01-10 22:41:16 +00:00
Henry
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
andy
eaef8d482b STYLE: Updated 1991 start copyright year to 2004 2011-01-14 16:08:00 +00:00
andy
099cc39e2e Revert "STYLE: 2011 copyright date."
This reverts commit b18f6cc1ce.
2011-01-05 18:24:29 +00:00
graham
b18f6cc1ce STYLE: 2011 copyright date. 2011-01-05 11:14:26 +00:00
Mark Olesen
499d48cfdb STYLE: uniform 'Test-' prefix for all applications/test
- easier to clean, avoid confusion with 'real' applications, etc.
2010-11-23 16:26:04 +01:00