51 #ifndef Foam_CStringList_H 52 #define Foam_CStringList_H 96 static inline char* stringCopy(
char* dest,
const char* src);
102 static inline char* stringCopy(
char *dest,
const std::string& src);
106 template<
class ListType>
107 int resetContent(
const ListType&
input);
130 std::initializer_list<const
char* const>
input 135 template<class StringType>
140 template<class StringType>
152 static inline
int count(const
char * const argv[]);
177 const char*
get(
int i)
const;
186 inline
char**
strings(
int start) const;
200 template<class StringType>
205 template<class StringType>
213 template<class StringType>
214 static
List<StringType>
asList(
int argc, const
char * const argv[]);
218 template<class StringType>
219 static inline
List<StringType>
asList(const
char * const argv[]);
225 inline const
char* operator[](
int i) const;
241 #include "CStringListI.H"
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.
int reset(std::initializer_list< const char *const > input)
Copy the input list of C-strings.
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.
void operator=(const CStringList &)=delete
No copy assignment.
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.