1
+ // Based on the https://github.com/arun11299/cpp-subprocess project.
2
+
1
3
/* !
2
4
3
- Documentation for C++ subprocessing libraray .
5
+ Documentation for C++ subprocessing library .
4
6
5
7
@copyright The code is licensed under the [MIT
6
8
License](http://opensource.org/licenses/MIT):
@@ -106,7 +108,7 @@ namespace subprocess {
106
108
// from pipe
107
109
static const size_t SP_MAX_ERR_BUF_SIZ = 1024 ;
108
110
109
- // Default buffer capcity for OutBuffer and ErrBuffer.
111
+ // Default buffer capacity for OutBuffer and ErrBuffer.
110
112
// If the data exceeds this capacity, the buffer size is grown
111
113
// by 1.5 times its previous capacity
112
114
static const size_t DEFAULT_BUF_CAP_BYTES = 8192 ;
@@ -312,8 +314,8 @@ namespace util
312
314
inline env_map_t MapFromWindowsEnvironment (){
313
315
wchar_t *variable_strings_ptr;
314
316
wchar_t *environment_strings_ptr;
315
- std::wstring delimeter (L" =" );
316
- int del_len = delimeter .length ();
317
+ std::wstring delimiter (L" =" );
318
+ int del_len = delimiter .length ();
317
319
env_map_t mapped_environment;
318
320
319
321
// Get a pointer to the environment block.
@@ -335,7 +337,7 @@ namespace util
335
337
// Create a string from Variable String
336
338
env_string_t current_line (variable_strings_ptr);
337
339
// Find the first "equals" sign.
338
- auto pos = current_line.find (delimeter );
340
+ auto pos = current_line.find (delimiter );
339
341
// Assuming it's not missing ...
340
342
if (pos!=std::wstring::npos){
341
343
// ... parse the key and value.
@@ -433,8 +435,8 @@ namespace util
433
435
* Function: join
434
436
* Parameters:
435
437
* [in] vec : Vector of strings which needs to be joined to form
436
- * a single string with words seperated by a seperator char.
437
- * [in] sep : String used to seperate 2 words in the joined string.
438
+ * a single string with words separated by a separator char.
439
+ * [in] sep : String used to separate 2 words in the joined string.
438
440
* Default constructed to ' ' (space).
439
441
* [out] string: Joined string.
440
442
*/
@@ -655,7 +657,7 @@ namespace util
655
657
* Default value is 0.
656
658
*/
657
659
struct bufsize {
658
- explicit bufsize (int siz ): bufsiz(siz ) {}
660
+ explicit bufsize (int sz ): bufsiz(sz ) {}
659
661
int bufsiz = 0 ;
660
662
};
661
663
@@ -711,7 +713,7 @@ struct string_arg
711
713
};
712
714
713
715
/* !
714
- * Option to specify the executable name seperately
716
+ * Option to specify the executable name separately
715
717
* from the args sequence.
716
718
* In this case the cmd args must only contain the
717
719
* options required for this executable.
@@ -728,7 +730,7 @@ struct executable: string_arg
728
730
* Option to set the current working directory
729
731
* of the spawned process.
730
732
*
731
- * Eg: cwd{"/som /path/x"}
733
+ * Eg: cwd{"/some /path/x"}
732
734
*/
733
735
struct cwd : string_arg
734
736
{
@@ -852,7 +854,7 @@ struct error
852
854
wr_ch_ = fd;
853
855
}
854
856
explicit error (IOTYPE typ) {
855
- assert ((typ == PIPE || typ == STDOUT) && " STDERR not aloowed " );
857
+ assert ((typ == PIPE || typ == STDOUT) && " STDERR not allowed " );
856
858
if (typ == PIPE) {
857
859
#ifndef __USING_WINDOWS__
858
860
std::tie (rd_ch_, wr_ch_) = util::pipe_cloexec ();
@@ -874,7 +876,7 @@ struct error
874
876
// ATTN: Can be used only to execute functions with no
875
877
// arguments and returning void.
876
878
// Could have used more efficient methods, ofcourse, but
877
- // that wont yield me the consistent syntax which I am
879
+ // that won't yield me the consistent syntax which I am
878
880
// aiming for. If you know, then please do let me know.
879
881
880
882
class preexec_func
@@ -1211,10 +1213,10 @@ class Streams
1211
1213
* 9. communicate(...) - Get the output/error from the child and close the channels
1212
1214
* from the parent side.
1213
1215
*10. input() - Get the input channel/File pointer. Can be used for
1214
- * cutomizing the way of sending input to child.
1216
+ * customizing the way of sending input to child.
1215
1217
*11. output() - Get the output channel/File pointer. Usually used
1216
1218
in case of redirection. See piping examples.
1217
- *12. error() - Get the error channel/File poiner . Usually used
1219
+ *12. error() - Get the error channel/File pointer . Usually used
1218
1220
in case of redirection.
1219
1221
*13. start_process() - Start the child process. Only to be used when
1220
1222
* `defer_spawn` option was provided in Popen constructor.
@@ -1358,7 +1360,7 @@ class Popen
1358
1360
1359
1361
// Command in string format
1360
1362
std::string args_;
1361
- // Comamnd provided as sequence
1363
+ // Command provided as sequence
1362
1364
std::vector<std::string> vargs_;
1363
1365
std::vector<char *> cargv_;
1364
1366
0 commit comments