51 #ifndef Foam_CStringList_H 52 #define Foam_CStringList_H 94 static inline char* stringCopy(
char* dest,
const char* src);
100 static inline char* stringCopy(
char *dest,
const std::string& src);
104 template<
class ListType>
105 int resetContent(
const ListType&
input);
128 std::initializer_list<const char* const>
input 133 template<
class StringType>
149 static inline int count(
const char *
const argv[]);
174 const char*
get(
int i)
const {
return argv_[i]; }
183 inline char**
strings(
int start)
const;
197 template<
class StringType>
200 return resetContent(
input);
207 return resetContent(
input);
215 template<
class StringType = std::
string>
220 template<
class StringType = std::
string>
227 const char*
operator[](
int i)
const {
return argv_[i]; }
234 Ostream&
operator<<(Ostream&
os,
const CStringList& list);
246 # include "CStringList.txx"
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...
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)
OBJstream os(runTime.globalPath()/outputName)
const char * cdata_bytes() const noexcept
The flattened character content, with interspersed nul-chars.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
void operator=(const CStringList &)=delete
No copy assignment.
~CStringList()
Destructor. Invokes clear() to free memory.
An adapter for copying a list of C++ strings into a list of C-style strings for passing to C code tha...
char ** strings() const noexcept
Return the list of C-strings (ie, argv)
static List< StringType > asList(int argc, const char *const argv[])
Create a list from argc/argv parameters.
const char * operator[](int i) const
Return element at the given index. No bounds checking.