string: Added construction from UList<char>

This commit is contained in:
Henry Weller
2020-03-19 16:44:28 +00:00
parent 4c08b463fd
commit 28b2f4cd8e
2 changed files with 16 additions and 3 deletions

View File

@ -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