Skip to content

Commit

Permalink
Add more keywords 2
Browse files Browse the repository at this point in the history
  • Loading branch information
OgreTransporter authored and dail8859 committed Nov 2, 2016
1 parent d1721d4 commit cf96151
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 10 deletions.
27 changes: 24 additions & 3 deletions Dialogs/SettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,30 @@ Format Keywords:\r\n\
$FUNCTION - The name of the function/method.\r\n\
$PARAM - Expands to a single function/method parameter. Any line containing this will get repeated for each parameter.\r\n\
$COMPUTER - Current computer name.\r\n\
$USER - User name of current user.\r\n\
$DATE - Current date and time.\r\n\
$YEAR - Part of date: year\r\n\
$USER - User account name of current user.\r\n\
$FULLUSER - full user name of current user.\r\n\
$DATE - Current date and time, format ISO 8601.\r\n\
$DATE_a - Abbreviated weekday name\r\n\
$DATE_A - Full weekday name\r\n\
$DATE_b - Abbreviated month name\r\n\
$DATE_B - Full month name\r\n\
$DATE_c - Date and time representation appropriate for locale\r\n\
$DATE_d - Day of month as decimal number (01 - 31)\r\n\
$DATE_H - Hour in 24 - hour format (00 - 23)\r\n\
$DATE_I - Hour in 12 - hour format (01 - 12)\r\n\
$DATE_j - Day of year as decimal number (001 - 366)\r\n\
$DATE_m - Month as decimal number (01 - 12)\r\n\
$DATE_M - Minute as decimal number (00 - 59)\r\n\
$DATE_p - Current locale's A.M./P.M. indicator for 12-hour clock\r\n\
$DATE_S - Second as decimal number (00 - 59)\r\n\
$DATE_U - Week of year as decimal number, with Sunday as first day of week (00 - 53)\r\n\
$DATE_w - Weekday as decimal number (0 - 6; Sunday is 0)\r\n\
$DATE_W - Week of year as decimal number, with Monday as first day of week (00 - 53)\r\n\
$DATE_x - Date representation for current locale\r\n\
$DATE_X - Time representation for current locale\r\n\
$DATE_y - Year without century, as decimal number (00 - 99)\r\n\
$DATE_Y - Year with century, as decimal number\r\n\
$DATE_z, $DATE_Z - Either the time - zone name or time zone abbreviation, depending on registry settings; no characters if time zone is unknown\r\n\
$@ - Expands to the prefix character for Doxygen commands.\r\n\
$| - Marks the alignment position. This is only valid for lines containing $PARAM.\r\n");

Expand Down
22 changes: 19 additions & 3 deletions Parsers/Parsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
#include "Parsers.h"
#include <vector>
#include <ctime>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#define SECURITY_WIN32
#include <Security.h>
#pragma comment(lib, "Secur32.lib")

const char *default_function_format =
"\r\n"
Expand Down Expand Up @@ -206,11 +211,22 @@ std::string FormatBlock(const ParserSettings *ps, Keywords& keywords, const std:
if (GetComputerNameA(infoBuf, &bufCharCount)) stringReplace(format_copy, "$COMPUTER", infoBuf);
bufCharCount = INFO_BUFFER_SIZE;
if (GetUserNameA(infoBuf, &bufCharCount)) stringReplace(format_copy, "$USER", infoBuf);
bufCharCount = INFO_BUFFER_SIZE;
if (GetUserNameExA(NameDisplay, infoBuf, &bufCharCount))
stringReplace(format_copy, "$FULLUSER", infoBuf);
else
stringReplace(format_copy, "$FULLUSER", "");
time_t t = std::time(NULL);
struct tm *ts = std::localtime(&t);
std::strftime(infoBuf, INFO_BUFFER_SIZE - 1, "%Y", ts);
stringReplace(format_copy, "$YEAR", infoBuf);
std::strftime(infoBuf, INFO_BUFFER_SIZE - 1, "%c", ts);
const char* character = "aAbBcdHIjmMpSUwWxXyYzZ";
for (size_t uj = 0; uj < strlen(character); uj++)
{
char format[3] = { '%', character[uj], 0 };
std::strftime(infoBuf, INFO_BUFFER_SIZE - 1, format, ts);
char search[8] = { '$', 'D', 'A', 'T', 'E', '_', character[uj], 0 };
stringReplace(format_copy, search, infoBuf);
}
std::strftime(infoBuf, INFO_BUFFER_SIZE - 1, "%Y-%m-%dT%H:%M:%S", ts);
stringReplace(format_copy, "$DATE", infoBuf);

// $FUNCTION may not exist
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,31 @@ The format string is used to customize the Doxygen Function Commenting block gen
- `$FILENAME` - The current file name.
- `$FUNCTION` - The name of the function/method.
- `$PARAM` - Expands to a single function/method parameter. Any line containing this will get repeated for each parameter.
- `$COMPUTER` - Current computer name.
- `$USER` - User account name of current user (for example, smith).
- `$FULLUSER` - Full user name of current user (for example, Jeff Smith).
- `$DATE` - Current date and time, format ISO 8601 (for example, 2009-06-30T18:30:00).
- `$DATE_a` - Abbreviated weekday name
- `$DATE_A` - Full weekday name
- `$DATE_b` - Abbreviated month name
- `$DATE_B` - Full month name
- `$DATE_c` - Date and time representation appropriate for locale
- `$DATE_d` - Day of month as decimal number (01 - 31)
- `$DATE_H` - Hour in 24-hour format (00 - 23)
- `$DATE_I` - Hour in 12-hour format (01 - 12)
- `$DATE_j` - Day of year as decimal number (001 - 366)
- `$DATE_m` - Month as decimal number (01 - 12)
- `$DATE_M` - Minute as decimal number (00 - 59)
- `$DATE_p` - Current locale's A.M./P.M. indicator for 12-hour clock
- `$DATE_S` - Second as decimal number (00 - 59)
- `$DATE_U` - Week of year as decimal number, with Sunday as first day of week (00 - 53)
- `$DATE_w` - Weekday as decimal number (0 - 6; Sunday is 0)
- `$DATE_W` - Week of year as decimal number, with Monday as first day of week (00 - 53)
- `$DATE_x` - Date representation for current locale
- `$DATE_X` - Time representation for current locale
- `$DATE_y` - Year without century, as decimal number (00 - 99)
- `$DATE_Y` - Year with century, as decimal number
- `$DATE_z`, `$DATE_Z` - Either the time-zone name or time zone abbreviation, depending on registry settings; no characters if time zone is unknown
- `$@` - Expands to the prefix character for Doxygen commands.
- `$|` - Marks the alignment position. This flag is only valid for lines containing $PARAM.

Expand Down
8 changes: 4 additions & 4 deletions Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

#define VERSION_NUM 0,2,7,0
#define VERSION_LINEAR 270
#define VERSION_LINEAR_TEXT TEXT("270")
#define VERSION_TEXT TEXT("0.2.7") // This must match the tag pushed on the server minus the "v"
#define VERSION_NUM 0,2,8,0
#define VERSION_LINEAR 280
#define VERSION_LINEAR_TEXT TEXT("280")
#define VERSION_TEXT TEXT("0.2.8") // This must match the tag pushed on the server minus the "v"
#define VERSION_STAGE TEXT("") // "alpha", "beta", ""

0 comments on commit cf96151

Please sign in to comment.