X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=Source%2FcmStringCommand.h;h=802e0b85009260d5e1ef2b94ca57a26de594df2a;hb=297c63fa65327491a2b50e521b661c5835a19fe4;hp=728b1bc5fcf94de8accedf8beca1a2ac8b13b270;hpb=ef8aa19c33e83ff019595fd7f8fdc29c35c336a3;p=platform%2Fupstream%2Fcmake.git diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index 728b1bc..802e0b8 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -93,6 +93,7 @@ public: " string(RANDOM [LENGTH ] [ALPHABET ]\n" " [RANDOM_SEED ] )\n" " string(FIND [REVERSE])\n" + " string(TIMESTAMP [] [UTC])\n" "REGEX MATCH will match the regular expression once and store the " "match in the output variable.\n" "REGEX MATCHALL will match the regular expression as many times as " @@ -128,13 +129,16 @@ public: "will search for the position of the last occurrence of the " "specified substring.\n" "The following characters have special meaning in regular expressions:\n" - " ^ Matches at beginning of a line\n" - " $ Matches at end of a line\n" + " ^ Matches at beginning of input\n" + " $ Matches at end of input\n" " . Matches any single character\n" " [ ] Matches any character(s) inside the brackets\n" " [^ ] Matches any character(s) not inside the brackets\n" " - Inside brackets, specifies an inclusive range between\n" " characters on either side e.g. [a-f] is [abcdef]\n" + " To match a literal - using brackets, make it the first\n" + " or the last character e.g. [+*/-] matches basic\n" + " mathematical operators.\n" " * Matches preceding pattern zero or more times\n" " + Matches preceding pattern one or more times\n" " ? Matches preceding pattern zero or once only\n" @@ -142,7 +146,37 @@ public: " () Saves a matched subexpression, which can be referenced \n" " in the REGEX REPLACE operation. Additionally it is saved\n" " by all regular expression-related commands, including \n" - " e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9)."; + " e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9).\n" + "*, + and ? have higher precedence than concatenation. | has lower " + "precedence than concatenation. This means that the regular expression " + "\"^ab+d$\" matches \"abbd\" but not \"ababd\", and the regular " + "expression \"^(ab|cd)$\" matches \"ab\" but not \"abd\".\n" + "TIMESTAMP will write a string representation of " + "the current date and/or time to the output variable.\n" + "Should the command be unable to obtain a timestamp " + "the output variable will be set to the empty string \"\".\n" + "The optional UTC flag requests the current date/time " + "representation to be in Coordinated Universal Time (UTC) " + "rather than local time.\n" + "The optional may contain the following " + "format specifiers: \n" + " %d The day of the current month (01-31).\n" + " %H The hour on a 24-hour clock (00-23).\n" + " %I The hour on a 12-hour clock (01-12).\n" + " %j The day of the current year (001-366).\n" + " %m The month of the current year (01-12).\n" + " %M The minute of the current hour (00-59).\n" + " %S The second of the current minute.\n" + " 60 represents a leap second. (00-60)\n" + " %U The week number of the current year (00-53).\n" + " %w The day of the current week. 0 is Sunday. (0-6)\n" + " %y The last two digits of the current year (00-99)\n" + " %Y The current year. \n" + "Unknown format specifiers will be ignored " + "and copied to the output as-is.\n" + "If no explicit is given it will default to:\n" + " %Y-%m-%dT%H:%M:%S for local time.\n" + " %Y-%m-%dT%H:%M:%SZ for UTC."; } cmTypeMacro(cmStringCommand, cmCommand); @@ -165,6 +199,7 @@ protected: bool HandleStripCommand(std::vector const& args); bool HandleRandomCommand(std::vector const& args); bool HandleFindCommand(std::vector const& args); + bool HandleTimestampCommand(std::vector const& args); class RegexReplacement {