summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/lib/parser.cc
Side-by-side diff
Diffstat (limited to 'noncore/net/opietooth/lib/parser.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/parser.cc60
1 files changed, 33 insertions, 27 deletions
diff --git a/noncore/net/opietooth/lib/parser.cc b/noncore/net/opietooth/lib/parser.cc
index 8baf284..7e95907 100644
--- a/noncore/net/opietooth/lib/parser.cc
+++ b/noncore/net/opietooth/lib/parser.cc
@@ -1,5 +1,11 @@
+#include "parser.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qstringlist.h>
-#include "parser.h"
@@ -15,3 +21,3 @@ namespace {
int convert( const QString& line, QString& ret ) {
-// qWarning("called");
+// owarn << "called" << oendl;
ret = QString::null;
@@ -21,9 +27,9 @@ int convert( const QString& line, QString& ret ) {
ret = line.left(pos ).stripWhiteSpace();
- // qWarning("ret: %s", ret.latin1() );
+ // owarn << "ret: " << ret.latin1() << oendl;
ret = ret.replace(QRegExp("[\"]"), "");
- //qWarning("ret: %s", ret.latin1() );
+ //owarn << "ret: " << ret.latin1() << oendl;
QString dummy = line.mid(pos + 5 );
- //qWarning("dummy: %s", dummy.latin1() );
+ //owarn << "dummy: " << dummy.latin1() << oendl;
dummy = dummy.replace(QRegExp("[)]"), "");
- //qWarning("dummy: %s", dummy.latin1() );
+ //owarn << "dummy: " << dummy.latin1() << oendl;
// dummy = dummy.remove( dummy.length() -2, 1 ); // remove the )
@@ -32,8 +38,8 @@ int convert( const QString& line, QString& ret ) {
//if (ok ) {
- // qWarning("converted %d", i);
- //}else qWarning("failed" );
- //qWarning("exiting");
+ // owarn << "converted " << i << oendl;
+ //}else owarn << "failed" << oendl;
+ //owarn << "exiting" << oendl;
return i;
}
- //qWarning("output %d", i );
+ //owarn << "output " << i << oendl;
return i;
@@ -59,3 +65,3 @@ void Parser::parse( const QString& string) {
for (it = list.begin(); it != list.end(); ++it ) {
- //qWarning("line:%s:line", (*it).latin1() );
+ //owarn << "line:" << (*it).latin1() << oendl;
if ( (*it).startsWith("Browsing") ) continue;
@@ -63,3 +69,3 @@ void Parser::parse( const QString& string) {
if ( (*it).stripWhiteSpace().isEmpty() ) { // line is empty because a new Service begins
- qWarning("could add");
+ owarn << "could add" << oendl;
// now see if complete and add
@@ -82,3 +88,3 @@ void Parser::parse( const QString& string) {
if (m_complete) {
-// qWarning("adding");
+// owarn << "adding" << oendl;
if (!m_item.serviceName().isEmpty() )
@@ -89,5 +95,5 @@ void Parser::parse( const QString& string) {
if (m_list.isEmpty() )
- qWarning("m_list is empty");
+ owarn << "m_list is empty" << oendl;
for (it2 = m_list.begin(); it2 != m_list.end(); ++it2 ) {
- qWarning("name %s", (*it2).serviceName().latin1() );
+ owarn << "name " << (*it2).serviceName().latin1() << oendl;
}
@@ -97,3 +103,3 @@ bool Parser::parseName( const QString& str) {
m_item.setServiceName( str.mid(13).stripWhiteSpace() );
- qWarning(m_item.serviceName() );
+ owarn << m_item.serviceName() << oendl;
return true;
@@ -105,3 +111,3 @@ bool Parser::parseRecHandle( const QString& str) {
QString out = str.mid(18 ).stripWhiteSpace();
- qWarning("out %s", out.latin1() );
+ owarn << "out " << out.latin1() << oendl;
int value = out.mid(2).toInt(&m_ok, 16 );
@@ -111,3 +117,3 @@ bool Parser::parseRecHandle( const QString& str) {
m_complete = false;
- qWarning("rec handle %d", value);
+ owarn << "rec handle " << value << oendl;
m_item.setRecHandle( value );
@@ -120,4 +126,4 @@ bool Parser::parseClassId( const QString& str) {
if (str.startsWith("Service Class ID List:") ) {
- qWarning("found class id" );
- qWarning("line:%s", str.latin1() );
+ owarn << "found class id" << oendl;
+ owarn << "line: " << str.latin1() << oendl;
m_classOver = true;
@@ -125,4 +131,4 @@ bool Parser::parseClassId( const QString& str) {
}else if ( m_classOver && str.startsWith(" " ) ){ // ok now are the informations in place
- qWarning("line with class id" );
- qWarning("%s",str.latin1() );
+ owarn << "line with class id" << oendl;
+ owarn << str.latin1() << oendl;
@@ -135,3 +141,3 @@ bool Parser::parseClassId( const QString& str) {
ids = convert( str, classes );
- qWarning("ids %d", ids );
+ owarn << "ids " << ids << oendl;
m_item.insertClassId( ids, classes );
@@ -140,3 +146,3 @@ bool Parser::parseClassId( const QString& str) {
}else{
- qWarning("Else %d", m_classOver );
+ owarn << "Else " << m_classOver << oendl;
m_classOver = false;
@@ -152,3 +158,3 @@ bool Parser::parseProtocol( const QString& str) {
}else if (m_protocolOver && str.startsWith(" ") ) { // "L2CAP" (0x0100)
- qWarning("double protocol filter");
+ owarn << "double protocol filter" << oendl;
@@ -164,3 +170,3 @@ bool Parser::parseProtocol( const QString& str) {
}else if (m_protocolOver && str.startsWith(" ") ) {
- qWarning("tripple protocol filter");
+ owarn << "tripple protocol filter" << oendl;
m_protocolAdded = true;
@@ -189,3 +195,3 @@ bool Parser::parseProfile( const QString& str) {
int dummy = str.mid(pos+1 ).stripWhiteSpace().toInt();
- qWarning("dummyInt:%d", dummy );
+ owarn << "dummyInt: " << dummy << oendl;
Services::ProfileDescriptor desc( m_profName, m_profId, dummy );