summaryrefslogtreecommitdiffstats
path: root/kate/cppsymbolviewer/cpp_parser.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 17:00:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 17:00:31 +0000
commit395a904bff7b4d6ead445c342f7ac0c5fbf29121 (patch)
tree9829cadb79d2cc7c29a940627fadb28b11e54150 /kate/cppsymbolviewer/cpp_parser.cpp
parent399f47c376fdf4d19192732a701ea9578d11619d (diff)
downloadtdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.tar.gz
tdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.zip
TQt4 port kdeaddons
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1237404 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kate/cppsymbolviewer/cpp_parser.cpp')
-rw-r--r--kate/cppsymbolviewer/cpp_parser.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/kate/cppsymbolviewer/cpp_parser.cpp b/kate/cppsymbolviewer/cpp_parser.cpp
index b666983..c99d455 100644
--- a/kate/cppsymbolviewer/cpp_parser.cpp
+++ b/kate/cppsymbolviewer/cpp_parser.cpp
@@ -3,7 +3,7 @@
-------------------
begin : Apr 2 2003
author : 2003 Massimo Callegari
***************************************************************************/
/***************************************************************************
* *
@@ -67,21 +67,21 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
cl = cl.stripWhiteSpace();
func_close = 0;
if(cl.at(0) == '/' && cl.at(1) == '/') continue;
- if(cl.find("/*") == 0 && (cl.find("*/") == ((signed)cl.length() - 2)) && graph == 0) continue; // workaround :(
- if(cl.find("/*") >= 0 && graph == 0) comment = 1;
- if(cl.find("*/") >= 0 && graph == 0) comment = 0;
- if(cl.find("#") >= 0 && graph == 0 ) macro = 1;
+ if(cl.tqfind("/*") == 0 && (cl.tqfind("*/") == ((signed)cl.length() - 2)) && graph == 0) continue; // workaround :(
+ if(cl.tqfind("/*") >= 0 && graph == 0) comment = 1;
+ if(cl.tqfind("*/") >= 0 && graph == 0) comment = 0;
+ if(cl.tqfind("#") >= 0 && graph == 0 ) macro = 1;
if (comment != 1)
{
/* *********************** MACRO PARSING *****************************/
if(macro == 1)
{
- //macro_pos = cl.find("#");
+ //macro_pos = cl.tqfind("#");
for (j = 0; j < cl.length(); j++)
{
if(cl.at(j)=='/' && cl.at(j+1)=='/') { macro = 4; break; }
- if( (uint)cl.find("define") == j &&
- !((uint)cl.find("defined") == j))
+ if( (uint)cl.tqfind("define") == j &&
+ !((uint)cl.tqfind("defined") == j))
{
macro = 2;
j += 6; // skip the word "define"
@@ -99,7 +99,7 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
if(j == cl.length() && macro == 1) macro = 0;
if(macro == 4)
{
- //stripped.replace(0x9, " ");
+ //stripped.tqreplace(0x9, " ");
stripped = stripped.stripWhiteSpace();
if (macro_on == true)
{
@@ -129,7 +129,7 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
/* ******************************************************************** */
- if ((cl.find("class") >= 0 && graph == 0 && block == 0))
+ if ((cl.tqfind("class") >= 0 && graph == 0 && block == 0))
{
mclass = 1;
for (j = 0; j < cl.length(); j++)
@@ -158,19 +158,19 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
}
if (mclass == 3)
{
- if (cl.find('{') >= 0)
+ if (cl.tqfind('{') >= 0)
{
- cl = cl.right(cl.find('{'));
+ cl = cl.right(cl.tqfind('{'));
mclass = 4;
}
}
- if(cl.find("(") >= 0 && cl.at(0) != '#' && block == 0 && comment != 2)
+ if(cl.tqfind("(") >= 0 && cl.at(0) != '#' && block == 0 && comment != 2)
{ structure = false; block = 1; }
- if((cl.find("typedef") >= 0 || cl.find("struct") >= 0) &&
+ if((cl.tqfind("typedef") >= 0 || cl.tqfind("struct") >= 0) &&
graph == 0 && block == 0)
{ structure = true; block = 2; stripped = ""; }
- //if(cl.find(";") >= 0 && graph == 0)
+ //if(cl.tqfind(";") >= 0 && graph == 0)
// block = 0;
if(block > 0 && mclass != 1 )
@@ -216,21 +216,21 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
break;
}
- if(cl.at(j)=='{' && structure == false && cl.find(";") < 0 ||
- cl.at(j)=='{' && structure == false && cl.find('}') > (int)j)
+ if(cl.at(j)=='{' && structure == false && cl.tqfind(";") < 0 ||
+ cl.at(j)=='{' && structure == false && cl.tqfind('}') > (int)j)
{
- stripped.replace(0x9, " ");
+ stripped.tqreplace(0x9, " ");
if(func_on == true)
{
if (types_on == false)
{
- while (stripped.find('(') >= 0)
- stripped = stripped.left(stripped.find('('));
- while (stripped.find("::") >= 0)
- stripped = stripped.mid(stripped.find("::") + 2);
+ while (stripped.tqfind('(') >= 0)
+ stripped = stripped.left(stripped.tqfind('('));
+ while (stripped.tqfind("::") >= 0)
+ stripped = stripped.mid(stripped.tqfind("::") + 2);
stripped = stripped.stripWhiteSpace();
- while (stripped.find(0x20) >= 0)
- stripped = stripped.mid(stripped.find(0x20, 0) + 1);
+ while (stripped.tqfind(0x20) >= 0)
+ stripped = stripped.mid(stripped.tqfind(0x20, 0) + 1);
}
//kdDebug(13000)<<"Function -- Inserted: "<<stripped<<" at row: "<<tmpPos<<" mclass: "<<(uint)mclass<<endl;
if (treeMode)
@@ -290,9 +290,9 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
{
if(cl.at(j) == ';')
{
- //stripped.replace(0x9, " ");
+ //stripped.tqreplace(0x9, " ");
stripped.remove('{');
- stripped.replace('}', " ");
+ stripped.tqreplace('}', " ");
if(struct_on == true)
{
if (treeMode)
@@ -319,9 +319,9 @@ void KatePluginSymbolViewerView::parseCppSymbols(void)
} // BLOCK > 0
if (mclass == 4 && block == 0 && func_close == 0)
{
- if (cl.find('}') >= 0)
+ if (cl.tqfind('}') >= 0)
{
- cl = cl.right(cl.find('}'));
+ cl = cl.right(cl.tqfind('}'));
mclass = 0;
}
}