| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2006 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 #define DECLARE_int(name) DECLARE_FLAG(int, name) | 182 #define DECLARE_int(name) DECLARE_FLAG(int, name) |
| 183 #define DECLARE_float(name) DECLARE_FLAG(double, name) | 183 #define DECLARE_float(name) DECLARE_FLAG(double, name) |
| 184 #define DECLARE_string(name) DECLARE_FLAG(const char*, name) | 184 #define DECLARE_string(name) DECLARE_FLAG(const char*, name) |
| 185 | 185 |
| 186 | 186 |
| 187 // The global list of all flags. | 187 // The global list of all flags. |
| 188 class FlagList { | 188 class FlagList { |
| 189 public: | 189 public: |
| 190 FlagList(); | 190 FlagList(); |
| 191 | 191 |
| 192 // The NULL-terminated list of all flags. Traverse with Flag::next(). | 192 // The null-terminated list of all flags. Traverse with Flag::next(). |
| 193 static Flag* list() { return list_; } | 193 static Flag* list() { return list_; } |
| 194 | 194 |
| 195 // If file != NULL, prints information for all flags defined in file; | 195 // If file != nullptr, prints information for all flags defined in file; |
| 196 // otherwise prints information for all flags in all files. The current | 196 // otherwise prints information for all flags in all files. The current flag |
| 197 // flag value is only printed if print_current_value is set. | 197 // value is only printed if print_current_value is set. |
| 198 static void Print(const char* file, bool print_current_value); | 198 static void Print(const char* file, bool print_current_value); |
| 199 | 199 |
| 200 // Lookup a flag by name. Returns the matching flag or NULL. | 200 // Lookup a flag by name. Returns the matching flag or null. |
| 201 static Flag* Lookup(const char* name); | 201 static Flag* Lookup(const char* name); |
| 202 | 202 |
| 203 // Helper function to parse flags: Takes an argument arg and splits it into | 203 // Helper function to parse flags: Takes an argument arg and splits it into |
| 204 // a flag name and flag value (or NULL if they are missing). is_bool is set | 204 // a flag name and flag value (or null if they are missing). is_bool is set |
| 205 // if the arg started with "-no" or "--no". The buffer may be used to NUL- | 205 // if the arg started with "-no" or "--no". The buffer may be used to NUL- |
| 206 // terminate the name, it must be large enough to hold any possible name. | 206 // terminate the name, it must be large enough to hold any possible name. |
| 207 static void SplitArgument(const char* arg, | 207 static void SplitArgument(const char* arg, |
| 208 char* buffer, int buffer_size, | 208 char* buffer, int buffer_size, |
| 209 const char** name, const char** value, | 209 const char** name, const char** value, |
| 210 bool* is_bool); | 210 bool* is_bool); |
| 211 | 211 |
| 212 // Set the flag values by parsing the command line. If remove_flags | 212 // Set the flag values by parsing the command line. If remove_flags |
| 213 // is set, the flags and associated values are removed from (argc, | 213 // is set, the flags and associated values are removed from (argc, |
| 214 // argv). Returns 0 if no error occurred. Otherwise, returns the | 214 // argv). Returns 0 if no error occurred. Otherwise, returns the |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 char **argv_; | 259 char **argv_; |
| 260 | 260 |
| 261 private: | 261 private: |
| 262 RTC_DISALLOW_COPY_AND_ASSIGN(WindowsCommandLineArguments); | 262 RTC_DISALLOW_COPY_AND_ASSIGN(WindowsCommandLineArguments); |
| 263 }; | 263 }; |
| 264 #endif // WEBRTC_WIN | 264 #endif // WEBRTC_WIN |
| 265 | 265 |
| 266 } // namespace rtc | 266 } // namespace rtc |
| 267 | 267 |
| 268 #endif // SHARED_COMMANDLINEFLAGS_FLAGS_H__ | 268 #endif // SHARED_COMMANDLINEFLAGS_FLAGS_H__ |
| OLD | NEW |