string: Added construction from UList<char>
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -25,7 +25,7 @@ License
|
||||
|
||||
#include "string.H"
|
||||
#include "stringOps.H"
|
||||
|
||||
#include "UList.H"
|
||||
|
||||
/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
|
||||
|
||||
@ -34,6 +34,14 @@ int Foam::string::debug(Foam::debug::debugSwitch(string::typeName, 0));
|
||||
const Foam::string Foam::string::null;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::string::string(const UList<char>& str)
|
||||
:
|
||||
std::string(str.begin(), str.end())
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::string::size_type Foam::string::count(const char c) const
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -67,6 +67,8 @@ Istream& operator>>(Istream&, string&);
|
||||
Ostream& operator<<(Ostream&, const string&);
|
||||
Ostream& operator<<(Ostream&, const std::string&);
|
||||
|
||||
template<class T>
|
||||
class UList;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class string Declaration
|
||||
@ -115,6 +117,9 @@ public:
|
||||
//- Construct as copy of character array
|
||||
inline string(const char*);
|
||||
|
||||
//- Construct as copy of UList of character
|
||||
string(const UList<char>&);
|
||||
|
||||
//- Construct as copy of specified number of characters
|
||||
inline string(const char*, const size_type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user