30 inline char* Foam::CStringList::stringCopy(
char* dest,
const char* src)
32 dest = std::copy_n(src, (src ? strlen(src) : 0), dest);
38 inline char* Foam::CStringList::stringCopy(
char *dest,
const std::string& src)
40 dest = std::copy_n(src.data(), src.size(), dest);
75 std::initializer_list<const char* const>
input 84 template<
class StringType>
93 template<
class StringType>
150 return &(argv_[start]);
154 template<
class StringType>
157 return resetContent(
input);
161 template<
class StringType>
164 return resetContent(
input);
void clear()
Clear contents and free memory.
const char * operator[](int i) const
Return element at the given index. No bounds checking.
const char * get(int i) const
Return string element at the given index. No bounds checking.
char ** strings() const noexcept
Return the list of C-strings (ie, argv)
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)
~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...