@@ -115,7 +115,8 @@ class Args {
115
115
// /
116
116
// / \return
117
117
// / The number or arguments in this object.
118
- size_t GetArgumentCount () const ;
118
+ size_t GetArgumentCount () const { return m_entries.size (); }
119
+
119
120
bool empty () const { return GetArgumentCount () == 0 ; }
120
121
121
122
// / Gets the NULL terminated C string argument pointer for the argument at
@@ -252,9 +253,9 @@ class Args {
252
253
// / If the argument was originally quoted, put in the quote char here.
253
254
void Unshift (llvm::StringRef arg_str, char quote_char = ' \0 ' );
254
255
255
- // Clear the arguments.
256
- //
257
- // For re-setting or blanking out the list of arguments.
256
+ // / Clear the arguments.
257
+ // /
258
+ // / For re-setting or blanking out the list of arguments.
258
259
void Clear ();
259
260
260
261
static lldb::Encoding
@@ -266,21 +267,20 @@ class Args {
266
267
static std::string GetShellSafeArgument (const FileSpec &shell,
267
268
llvm::StringRef unsafe_arg);
268
269
269
- // EncodeEscapeSequences will change the textual representation of common
270
- // escape sequences like "\n" (two characters) into a single '\n'. It does
271
- // this for all of the supported escaped sequences and for the \0ooo (octal)
272
- // and \xXX (hex). The resulting "dst" string will contain the character
273
- // versions of all supported escape sequences. The common supported escape
274
- // sequences are: "\a", "\b", "\f", "\n", "\r", "\t", "\v", "\'", "\"", "\\".
275
-
270
+ // / EncodeEscapeSequences will change the textual representation of common
271
+ // / escape sequences like "\n" (two characters) into a single '\n'. It does
272
+ // / this for all of the supported escaped sequences and for the \0ooo (octal)
273
+ // / and \xXX (hex). The resulting "dst" string will contain the character
274
+ // / versions of all supported escape sequences. The common supported escape
275
+ // / sequences are: "\a", "\b", "\f", "\n", "\r", "\t", "\v", "\'", "\"", "\\".
276
276
static void EncodeEscapeSequences (const char *src, std::string &dst);
277
277
278
- // ExpandEscapeSequences will change a string of possibly non-printable
279
- // characters and expand them into text. So '\n' will turn into two
280
- // characters like "\n" which is suitable for human reading. When a character
281
- // is not printable and isn't one of the common in escape sequences listed in
282
- // the help for EncodeEscapeSequences, then it will be encoded as octal.
283
- // Printable characters are left alone.
278
+ // / ExpandEscapeSequences will change a string of possibly non-printable
279
+ // / characters and expand them into text. So '\n' will turn into two
280
+ // / characters like "\n" which is suitable for human reading. When a character
281
+ // / is not printable and isn't one of the common in escape sequences listed in
282
+ // / the help for EncodeEscapeSequences, then it will be encoded as octal.
283
+ // / Printable characters are left alone.
284
284
static void ExpandEscapedCharacters (const char *src, std::string &dst);
285
285
286
286
static std::string EscapeLLDBCommandArgument (const std::string &arg,
@@ -290,6 +290,10 @@ class Args {
290
290
friend struct llvm ::yaml::MappingTraits<Args>;
291
291
292
292
std::vector<ArgEntry> m_entries;
293
+ // / The arguments as C strings with a trailing nullptr element.
294
+ // /
295
+ // / These strings are owned by the ArgEntry object in m_entries with the
296
+ // / same index.
293
297
std::vector<char *> m_argv;
294
298
};
295
299
0 commit comments