51 #ifndef Foam_CStringList_H 52 #define Foam_CStringList_H 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[]);
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" int reset(const UList< StringType > &input)
Copy the input list of strings.
void clear()
Clear contents and free memory.
size_t length() const noexcept
Same as size_bytes()
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
char ** strings() const noexcept
Return the list of C-strings (ie, argv)
size_t size_bytes() const noexcept
Overall length of the flattened character (data) content including interspersed nul-chars but not the...
const char * data() const noexcept
Same as cdata_bytes()
bool empty() const noexcept
True if the size (ie, argc) is zero.
int size() const noexcept
Return the number of C-strings (ie, argc)
Sub-ranges of a string with a structure similar to std::match_results, but without the underlying reg...
static int count(const char *const argv[])
Count the number of parameters until the first nullptr.
constexpr CStringList() noexcept
Default construct, adding content later (via reset).
static Istream & input(Istream &is, IntRange< T > &range)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
const char * cdata_bytes() const noexcept
The flattened character content, with interspersed nul-chars.
An adapter for copying a list of C++ strings into a list of C-style strings for passing to C code tha...
static List< StringType > asList(int argc, const char *const argv[])
Create a list from argc/argv parameters.