OLD | NEW |
1 // Copyright (c) 2010, Google Inc. | 1 // Copyright (c) 2010, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 #include <string.h> | 30 #include <string.h> |
31 | 31 |
32 #include <string> | 32 #include <string> |
33 #include <vector> | 33 #include <vector> |
34 | 34 |
35 #include "common/using_std_string.h" | 35 #include "common/using_std_string.h" |
36 | 36 |
37 namespace google_breakpad { | 37 namespace google_breakpad { |
38 | 38 |
39 #ifdef _WIN32 | 39 #ifdef _MSC_VER |
40 #define strtok_r strtok_s | 40 #define strtok_r strtok_s |
41 #endif | 41 #endif |
42 | 42 |
43 using std::vector; | 43 using std::vector; |
44 | 44 |
45 bool Tokenize(char *line, | 45 bool Tokenize(char *line, |
46 const char *separators, | 46 const char *separators, |
47 int max_tokens, | 47 int max_tokens, |
48 vector<char*> *tokens) { | 48 vector<char*> *tokens) { |
49 tokens->clear(); | 49 tokens->clear(); |
(...skipping 20 matching lines...) Expand all Loading... |
70 } | 70 } |
71 | 71 |
72 void StringToVector(const string &str, vector<char> &vec) { | 72 void StringToVector(const string &str, vector<char> &vec) { |
73 vec.resize(str.length() + 1); | 73 vec.resize(str.length() + 1); |
74 std::copy(str.begin(), str.end(), | 74 std::copy(str.begin(), str.end(), |
75 vec.begin()); | 75 vec.begin()); |
76 vec[str.length()] = '\0'; | 76 vec[str.length()] = '\0'; |
77 } | 77 } |
78 | 78 |
79 } // namespace google_breakpad | 79 } // namespace google_breakpad |
OLD | NEW |