[Kita-svn] [2530] make some functions static

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 8月 8日 (土) 18:16:58 JST


Revision: 2530
          http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2530
Author:   nogu
Date:     2009-08-08 18:16:58 +0900 (Sat, 08 Aug 2009)

Log Message:
-----------
make some functions static

Modified Paths:
--------------
    kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp
    kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h

Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp	2009-08-07 15:00:43 UTC (rev 2529)
+++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp	2009-08-08 09:16:58 UTC (rev 2530)
@@ -704,7 +704,17 @@
 /*-------------------------------------------------*/
 /*-------------------------------------------------*/
 
+static void parseName(const QString& rawStr, RESDAT& resdat);
+static void parseDateId(const QString& rawStr, RESDAT& resdat);
+static void parseBody(const QString &rawStr, RESDAT& resdat);
 
+static bool parseLink(const QChar *cdat, const unsigned int length,
+        QString& linkstr, QString& linkurl, unsigned int& pos);
+static bool parseResAnchor(const QChar *cdat, const unsigned int length,
+        QString& linkstr, int* refNum, unsigned int& pos);
+static bool createResAnchor(const QString &rawStr, RESDAT& resdat,
+        const QChar *chpt, unsigned int &i, unsigned int &index);
+
 /* Main Parser */
 
 /*
@@ -790,7 +800,7 @@
    resdat.nameHTML
    
 */
-void Kita::parseName(const QString& rawStr, RESDAT& resdat)
+void parseName(const QString& rawStr, RESDAT& resdat)
 {
     unsigned int i = 0, pos;
     int refNum[ 2 ];
@@ -842,7 +852,7 @@
    resdat.host
  
 */
-void Kita::parseDateId(const QString& rawStr, RESDAT& resdat)
+void parseDateId(const QString& rawStr, RESDAT& resdat)
 {
     resdat.date = rawStr;
     resdat.id.clear();
@@ -910,11 +920,11 @@
    resdat.bodyHTML
  
 */
-void Kita::parseBody(const QString &rawStr, RESDAT& resdat)
+void parseBody(const QString &rawStr, RESDAT& resdat)
 {
     resdat.bodyHTML.clear();
 
-    unsigned int startPos, pos;
+    unsigned int startPos;
     QString linkstr, linkurl;
     const QChar *chpt = rawStr.unicode();
     unsigned int length = rawStr.length();
@@ -970,16 +980,17 @@
 
         case 'h':     /* "http://" or "ttp://" or "tp:" */
         case 't':
+            {
+                unsigned int pos = 0;
+                if (parseLink(chpt + i, length - i, linkstr, linkurl, pos)) {
+                    resdat.bodyHTML += rawStr.mid(startPos, i - startPos);
+                    resdat.bodyHTML += "<a href=\"" + linkurl + "\">";
+                    resdat.bodyHTML += linkstr;
+                    resdat.bodyHTML += "</a>";
 
-            if (parseLink(chpt + i, length - i, linkstr, linkurl, pos)) {
-
-                resdat.bodyHTML += rawStr.mid(startPos, i - startPos);
-                resdat.bodyHTML += "<a href=\"" + linkurl + "\">";
-                resdat.bodyHTML += linkstr;
-                resdat.bodyHTML += "</a>";
-
-                startPos = i + pos;
-                i = startPos - 1;
+                    startPos = i + pos;
+                    i = startPos - 1;
+                }
             }
 
             break;
@@ -1029,7 +1040,7 @@
  
    and return true.
                                 */
-bool Kita::parseLink(
+bool parseLink(
 
     /* input */
     const QChar *cdat, const unsigned int length,
@@ -1101,7 +1112,7 @@
    ret = true;
  
 */
-bool Kita::parseResAnchor(
+bool parseResAnchor(
 
     /* input */
     const QChar *cdat, const unsigned int length,
@@ -1202,7 +1213,7 @@
 /* create res anchor  */
 /* This function is called from parseBody internally.
    See also parseBody.                                */
-bool Kita::createResAnchor(const QString &rawStr, RESDAT& resdat,
+bool createResAnchor(const QString &rawStr, RESDAT& resdat,
                             const QChar *chpt, unsigned int &i, unsigned int &startPos)
 {
     QString linkstr, linkurl;

Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h	2009-08-07 15:00:43 UTC (rev 2529)
+++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.h	2009-08-08 09:16:58 UTC (rev 2530)
@@ -87,17 +87,6 @@
     /* for 2ch */
     bool parseResDat(RESDAT& resdat, QString& subject);
 
-    void parseName(const QString& rawStr, RESDAT& resdat);
-    void parseDateId(const QString& rawStr, RESDAT& resdat);
-    void parseBody(const QString &rawStr, RESDAT& resdat);
-
-    bool parseLink(const QChar *cdat, const unsigned int length,
-                    QString& linkstr, QString& linkurl, unsigned int& pos);
-    bool parseResAnchor(const QChar *cdat, const unsigned int length,
-                         QString& linkstr, int* refNum, unsigned int& pos);
-    bool createResAnchor(const QString &rawStr, RESDAT& resdat,
-                          const QChar *chpt, unsigned int &i, unsigned int &index);
-
     void createTitleHTML(RESDAT& resdat, QString& titletext);
 }
 




Kita-svn メーリングリストの案内
Back to archive index