OSDN Git Service

PATCH: [ 1530459 ] Add some doxygen comments for ViewableWhitespace
authorKimmo Varis <kimmov@gmail.com>
Mon, 31 Jul 2006 17:14:15 +0000 (17:14 +0000)
committerKimmo Varis <kimmov@gmail.com>
Mon, 31 Jul 2006 17:14:15 +0000 (17:14 +0000)
Src/Changes.txt
Src/ViewableWhitespace.cpp
Src/ViewableWhitespace.h

index 817fc7a..25a823f 100644 (file)
@@ -8,6 +8,8 @@ Add new items to top.
  PATCH: [ 1406051 ] code cleanup for ScriptFileActions
   Submitted by Perry
   Src: DirActions.cpp FileActionScript.cpp FileActionScript.h
+ PATCH: [ 1530459 ] Add some doxygen comments for ViewableWhitespace
+  Src: ViewableWhitespace.cpp ViewableWhitespace.h
 
 2006-07-30 Takashi
  BUG: [ 1528322 ] Crash when using F6 / Bugg for file differences
index e2e4df2..1ba28e9 100644 (file)
@@ -9,21 +9,30 @@
 #include "StdAfx.h" 
 #include "ViewableWhitespace.h"
 
-static bool f_initialized=false;
+/** @brief Is structure initialized? */
+static bool f_initialized = false;
 
 #ifdef UNICODE
 // For UNICODE build, there is just one set which is always used
 // tab, space, cr, lf, eol
-struct ViewableWhitespaceChars
+
+/** @brief Structure for whitespace characters.
+ *  Char order is tab, space, cr, lf, eol.
+ */
+static struct ViewableWhitespaceChars
 // Do not use L literals, as they involve runtime mbcs expansion, apparently
  f_specialChars = {
-       0
-       , L" " // U+BB: RIGHT POINTING DOUBLE ANGLE QUOTATION MARK
-       , L" " // U+B7: MIDDLE DOT
-       , L" " // U+A7: SECTION SIGN
-       , L" " // U+B6: PILCROW SIGN
-       L" " // U+A4: CURRENCY SIGN
+       0,
+       L" ", // U+BB: RIGHT POINTING DOUBLE ANGLE QUOTATION MARK
+       L" ", // U+B7: MIDDLE DOT
+       L" ", // U+A7: SECTION SIGN
+       L" ", // U+B6: PILCROW SIGN
+       L" " // U+A4: CURRENCY SIGN
 };
+
+/**
+ * @brief Initialize whitespace chars structure.
+ */
 static void initialize()
 {
        f_specialChars.c_tab[0] = 0xBB;
@@ -40,6 +49,9 @@ static void initialize()
 static CMap<int, int, int, int> f_offset; // map codepage to offset
 
 // tab, space, cr, lf, eol
+/** @brief Structure for whitespace characters.
+ *  Char order is tab, space, cr, lf, eol.
+ */
 static struct ViewableWhitespaceChars
  f_specialChars[] = {
         { 0, ">", ".", "$", "!", "&" } // default all-ASCII for unhandled codepages
@@ -75,6 +87,9 @@ static struct ViewableWhitespaceChars
        , { 1257, "\xBB", "\xB7", "\xA7", "\xB6", "\xA4" } // CP-1257 Windows Baltic Rim
 };
 
+/**
+ * @brief Initialize whitespace chars structure.
+ */
 static void initialize()
 {
        for (int i=0; i<sizeof(f_specialChars)/sizeof(f_specialChars[0]); ++i)
@@ -88,7 +103,11 @@ static void initialize()
 
 #endif
 
-
+/**
+ * @brief Return viewable whitespace chars.
+ * @param [in] codepage Used codepage (only efective in ANSI builds).
+ * @return Pointer to structure having viewable chars.
+ */
 const ViewableWhitespaceChars * GetViewableWhitespaceChars(int codepage)
 {
        if (!f_initialized)
index 4b45f96..07c21ca 100644 (file)
@@ -1,13 +1,28 @@
+/** 
+ * @file  ViewableWhitespace.h
+ *
+ * @brief Repository of character tables used to display whitespace (when View/Whitespace enabled)
+ */
+// RCS ID line follows -- this is updated by CVS
+// $Id$
+
 #ifndef ViewableWhitespace_included_h
 #define ViewableWhitespace_included_h
 
-struct ViewableWhitespaceChars {
-       int c_codepage; // unused in UNICODE
-       TCHAR c_tab[3];
-       TCHAR c_space[3];
-       TCHAR c_cr[3];
-       TCHAR c_lf[3];
-       TCHAR c_eol[3]; // generic eol
+/**
+ * @brief Structure containing characters for viewable whitespace chars.
+ *
+ * These characters are used when user wants to see whitespace characters
+ * in editor.
+ */
+struct ViewableWhitespaceChars
+{
+       int c_codepage; /**< Used codepage, unused in UNICODE. */
+       TCHAR c_tab[3]; /**< Visible character for tabs. */
+       TCHAR c_space[3]; /**< Visible character for spaces. */
+       TCHAR c_cr[3]; /**< Visible character for CR EOL chars. */
+       TCHAR c_lf[3]; /**< Visible character for LF EOL chars. */
+       TCHAR c_eol[3]; /**< Visible character for general EOL chars. */
 };
 
 const ViewableWhitespaceChars * GetViewableWhitespaceChars(int codepage);