| Index: tools/flags/SkCommandLineFlags.h
|
| diff --git a/tools/SkFlags.h b/tools/flags/SkCommandLineFlags.h
|
| similarity index 94%
|
| rename from tools/SkFlags.h
|
| rename to tools/flags/SkCommandLineFlags.h
|
| index c510707f83e50c2bc4adeea987f6cbb6e1fabcc0..1d4f409fbf7f443d1c4ae7b5a08c56411d6bf9a2 100644
|
| --- a/tools/SkFlags.h
|
| +++ b/tools/flags/SkCommandLineFlags.h
|
| @@ -5,14 +5,14 @@
|
| * found in the LICENSE file.
|
| */
|
|
|
| -#ifndef SK_FLAGS_H
|
| -#define SK_FLAGS_H
|
| +#ifndef SK_COMMAND_LINE_FLAGS_H
|
| +#define SK_COMMAND_LINE_FLAGS_H
|
|
|
| #include "SkString.h"
|
| #include "SkTDArray.h"
|
|
|
| /**
|
| - * Including this file (and compiling SkFlags.cpp) provides command line
|
| + * Including this file (and compiling SkCommandLineFlags.cpp) provides command line
|
| * parsing. In order to use it, use the following macros in global
|
| * namespace:
|
| *
|
| @@ -21,8 +21,8 @@
|
| * DEFINE_int32(name, defaultValue, helpString);
|
| * DEFINE_double(name, defaultValue, helpString);
|
| *
|
| - * Then, in main, call SkFlags::SetUsage() to describe usage and call
|
| - * SkFlags::ParseCommandLine() to parse the flags. Henceforth, each flag can
|
| + * Then, in main, call SkCommandLineFlags::SetUsage() to describe usage and call
|
| + * SkCommandLineFlags::Parse() to parse the flags. Henceforth, each flag can
|
| * be referenced using
|
| *
|
| * FLAGS_name
|
| @@ -85,8 +85,8 @@
|
| *
|
| * Inspired by gflags (https://code.google.com/p/gflags/). Is not quite as
|
| * robust as gflags, but suits our purposes. For example, allows creating
|
| - * a flag -h or -help which will never be used, since SkFlags handles it.
|
| - * SkFlags will also allow creating --flag and --noflag. Uses the same input
|
| + * a flag -h or -help which will never be used, since SkCommandLineFlags handles it.
|
| + * SkCommandLineFlags will also allow creating --flag and --noflag. Uses the same input
|
| * format as gflags and creates similarly named variables (i.e. FLAGS_name).
|
| * Strings are handled differently (resulting variable will be an array of
|
| * strings) so that a flag can be followed by multiple parameters.
|
| @@ -95,12 +95,12 @@
|
|
|
| class SkFlagInfo;
|
|
|
| -class SkFlags {
|
| +class SkCommandLineFlags {
|
|
|
| public:
|
| /**
|
| * Call to set the help message to be displayed. Should be called before
|
| - * ParseCommandLine.
|
| + * Parse.
|
| */
|
| static void SetUsage(const char* usage);
|
|
|
| @@ -108,7 +108,7 @@ public:
|
| * Call at the beginning of main to parse flags created by DEFINE_x, above.
|
| * Must only be called once.
|
| */
|
| - static void ParseCommandLine(int argc, char** argv);
|
| + static void Parse(int argc, char** argv);
|
|
|
| private:
|
| static SkFlagInfo* gHead;
|
| @@ -344,8 +344,8 @@ private:
|
| , fDoubleValue(NULL)
|
| , fDefaultDouble(0)
|
| , fStrings(NULL) {
|
| - fNext = SkFlags::gHead;
|
| - SkFlags::gHead = this;
|
| + fNext = SkCommandLineFlags::gHead;
|
| + SkCommandLineFlags::gHead = this;
|
| }
|
| // Name of the flag, without initial dashes
|
| SkString fName;
|
| @@ -365,4 +365,4 @@ private:
|
| // In order to keep a linked list.
|
| SkFlagInfo* fNext;
|
| };
|
| -#endif // SK_FLAGS_H
|
| +#endif // SK_COMMAND_LINE_FLAGS_H
|
|
|