51#ifndef Foam_CStringList_H
52#define Foam_CStringList_H
64template<
class StringType>
class SubStrings;
94 static inline char* stringCopy(
char *dest,
const std::string& src);
98 template<
class ListType>
99 int resetContent(
const ListType&
input);
118 template<
class StringType>
123 template<
class StringType>
135 static inline int count(
const char *
const argv[]);
141 inline bool empty()
const noexcept;
144 inline int size()
const noexcept;
160 const char*
get(
int i)
const;
169 inline
char**
strings(
int start) const;
179 template<class StringType>
184 template<class StringType>
192 template<class StringType>
193 static
List<StringType>
asList(
int argc, const
char * const argv[]);
197 template<class StringType>
198 static inline
List<StringType>
asList(const
char * const argv[]);
204 inline const
char* operator[](
int i) const;
220#include "CStringListI.H"
An adapter for copying a list of C++ strings into a list of C-style strings for passing to C code tha...
~CStringList()
Destructor. Invokes clear() to free memory.
int size() const noexcept
Return the number of C-strings (ie, argc)
static List< StringType > asList(int argc, const char *const argv[])
Create a list from argc/argv parameters.
constexpr CStringList() noexcept
Default construct, adding content later (via reset).
const char * data() const noexcept
Same as cdata_bytes()
static int count(const char *const argv[])
Count the number of parameters until the first nullptr.
bool empty() const noexcept
True if the size (ie, argc) is zero.
char ** strings() const noexcept
Return the list of C-strings (ie, argv)
int reset(const UList< StringType > &input)
Copy the input list of strings.
size_t length() const noexcept
Same as size_bytes()
size_t size_bytes() const noexcept
const char * cdata_bytes() const noexcept
The flattened character content, with interspersed nul-chars.
void clear()
Clear contents and free memory.
const char * get(int i) const
Return string element at the given index. No bounds checking.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Sub-ranges of a string with a structure similar to std::match_results, but without the underlying reg...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
OBJstream os(runTime.globalPath()/outputName)
static Istream & input(Istream &is, IntRange< T > &range)