STYLE: adjust deprecations for OSspecific

- skip processing OSspecific/MSwindows since this can cause duplicate
  doxygen entries

STYLE: adjust formatting in code templates

STYLE: use std::string methods without extra qualifications
This commit is contained in:
Mark Olesen 2019-12-13 11:08:12 +01:00
parent 370c8a39af
commit b61d4ab488
8 changed files with 57 additions and 68 deletions

View File

@ -816,7 +816,8 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is # Note that relative paths are relative to the directory from which doxygen is
# run. # run.
EXCLUDE = # Avoid duplicate entries that would arise from OSspecific/MSwindows
EXCLUDE = $(WM_PROJECT_DIR)/src/OSspecific/MSwindows
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded # directories that are symbolic links (a Unix file system feature) are excluded

View File

@ -62,7 +62,7 @@ class CLASSNAME
: :
public baseClassName public baseClassName
{ {
// Private data // Private Data
//- Description of data_ //- Description of data_
dataType data_; dataType data_;
@ -79,12 +79,24 @@ class CLASSNAME
public: public:
// Static data members // Static Data Members
//- Static data staticData //- Static data staticData
static const dataType staticData; static const dataType staticData;
// Generated Methods
// //- Construct null
// CLASSNAME() = default;
//
// //- Copy construct
// CLASSNAME(const CLASSNAME&) = default;
//
// //- Copy assignment
// CLASSNAME& operator=(const CLASSNAME&) = default;
// Constructors // Constructors
//- Construct null //- Construct null

View File

@ -67,7 +67,7 @@ class CLASSNAME
: :
public baseClassName public baseClassName
{ {
// Private data // Private Data
dataType data_; dataType data_;
@ -83,11 +83,22 @@ class CLASSNAME
public: public:
// Static data members // Static Data Members
//- Static data someStaticData //- Static data someStaticData
static const dataType staticData; static const dataType staticData;
// Generated Methods
// //- Construct null
// CLASSNAME() = default;
//
// //- Copy construct
// CLASSNAME(const CLASSNAME&) = default;
//
// //- Copy assignment
// CLASSNAME& operator=(const CLASSNAME&) = default;
// Constructors // Constructors

View File

@ -159,14 +159,6 @@ public:
friend Istream& operator>>(Istream& is, fileStat& fs); friend Istream& operator>>(Istream& is, fileStat& fs);
friend Ostream& operator<<(Ostream& os, const fileStat& fs); friend Ostream& operator<<(Ostream& os, const fileStat& fs);
// Housekeeping
//- Deprecated(2019-04) Was file-stat successful?
// \deprecated(2019-04) - use valid() method
bool isValid() const { return valid_; }
}; };

View File

@ -159,14 +159,6 @@ public:
friend Istream& operator>>(Istream& is, fileStat& fs); friend Istream& operator>>(Istream& is, fileStat& fs);
friend Ostream& operator<<(Ostream& os, const fileStat& fs); friend Ostream& operator<<(Ostream& os, const fileStat& fs);
// Housekeeping
//- Deprecated(2019-04) Was file-stat successful?
// \deprecated(2019-04) - use valid() method
bool isValid() const { return valid_; }
}; };

View File

@ -33,10 +33,21 @@ Description
The PCRE '(?i)' extension is provided to compile the regular expression The PCRE '(?i)' extension is provided to compile the regular expression
as being case-insensitive. as being case-insensitive.
See also SeeAlso
The manpage regex(7) for more information about POSIX regular expressions. The manpage regex(7) for more information about POSIX regular expressions.
These differ somewhat from \c Perl and \c sed regular expressions. These differ somewhat from \c Perl and \c sed regular expressions.
SeeAlso
Foam::regExp and Foam::regExpCxx
Warning
This class should not be used directly.
Use the Foam::regExp typedef instead.
\deprecated
This class will be superseded by Foam::regExpCxx as compiler support
for regular expressions continues to improve.
SourceFiles SourceFiles
regExpPosixI.H regExpPosixI.H
regExpPosix.C regExpPosix.C
@ -49,13 +60,6 @@ SourceFiles
#include <regex.h> #include <regex.h>
#include <string> #include <string>
// Transitional feature - support std::smatch as per C++11 regex
#undef Foam_regExpPosix_cxx
#ifdef Foam_regExpPosix_cxx
#include <regex>
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
@ -80,18 +84,13 @@ public:
// Public Types // Public Types
#ifdef Foam_regExpPosix_cxx //- Type for matches - similar to std::smatch
//- Type for matches, as per C++11 regex
typedef std::smatch results_type;
#else
//- Type for matches, use OpenFOAM SubStrings container
typedef SubStrings<std::string> results_type; typedef SubStrings<std::string> results_type;
#endif
// Static Member Data // Static Member Data
//- The default grammar (unused) - for future-compatibility //- Grammar (unused) - for compatibility with Foam::regExpCxx
static int grammar; static int grammar;

View File

@ -45,6 +45,10 @@ Note
For example, gcc 4.8 is known to fail. For example, gcc 4.8 is known to fail.
For these systems the POSIX implementation or alternative must be used. For these systems the POSIX implementation or alternative must be used.
Warning
This class should not be used directly.
Use the Foam::regExp typedef instead.
SourceFiles SourceFiles
regExpCxxI.H regExpCxxI.H
regExpCxx.C regExpCxx.C
@ -209,7 +213,6 @@ public:
//- Assign and compile pattern from string. //- Assign and compile pattern from string.
// Matching is case sensitive. // Matching is case sensitive.
inline void operator=(const std::string& pattern); inline void operator=(const std::string& pattern);
}; };

View File

@ -203,7 +203,7 @@ static void expandLeading(std::string& s)
} }
else if (s[1] == '/') else if (s[1] == '/')
{ {
s.std::string::replace(0, 1, cwd()); s.replace(0, 1, cwd());
} }
break; break;
} }
@ -651,13 +651,7 @@ static void expandString
) )
); );
s.std::string::replace s.replace(replaceBeg, varBeg - replaceBeg, varValue);
(
replaceBeg,
varBeg - replaceBeg,
varValue
);
varBeg = replaceBeg+varValue.size(); varBeg = replaceBeg+varValue.size();
} }
else else
@ -677,12 +671,7 @@ static void expandString
) )
); );
s.std::string::replace s.replace(varBeg, varName.size()+1, varValue);
(
varBeg,
varName.size()+1,
varValue
);
varBeg += varValue.size(); varBeg += varValue.size();
} }
} }
@ -842,29 +831,19 @@ void Foam::stringOps::inplaceExpand
// Found and ":+" alternative // Found and ":+" alternative
// Not-found and ":-" alternative // Not-found and ":-" alternative
s.std::string::replace s.replace(varBeg, varEnd - varBeg + 1, altValue);
(
varBeg,
varEnd - varBeg + 1,
altValue
);
varBeg += altValue.size(); varBeg += altValue.size();
} }
else if (fnd.found()) else if (fnd.found())
{ {
// Found: use value // Found: use value
s.std::string::replace s.replace(varBeg, varEnd - varBeg + 1, *fnd);
(
varBeg,
varEnd - varBeg + 1,
*fnd
);
varBeg += (*fnd).size(); varBeg += (*fnd).size();
} }
else else
{ {
// Not-found: empty value // Not-found: empty value
s.std::string::erase(varBeg, varEnd - varBeg + 1); s.erase(varBeg, varEnd - varBeg + 1);
} }
} }
} }