Modified:
trunk/MYSQLPlus/MYSQLPlusLib/MCommand.cpp
trunk/MYSQLPlus/MYSQLPlusLib/MCommand.h
Log:
more work on MCommands/MCommand
Modified: trunk/MYSQLPlus/MYSQLPlusLib/MCommand.cpp
===================================================================
--- trunk/MYSQLPlus/MYSQLPlusLib/MCommand.cpp 2006-08-01 00:00:53 UTC (rev 471)
+++ trunk/MYSQLPlus/MYSQLPlusLib/MCommand.cpp 2006-08-01 07:15:40 UTC (rev 472)
@@ -69,6 +69,7 @@
BOOLEAN bBraceCheck = true;
QString stringQuotes = "\"'";
int nCharsSkipped = 0;
+ QString stringSegment;
/* clear any existing processing */
doClear();
@@ -123,10 +124,6 @@
if ( bBraceCheck && nBraceNest == 0 && !cChar.isSpace() )
bBraceCheck = false;
- /* parameter marker */
- if ( cQuote.isNull() && cChar == cMarker )
- listParameterMarkers.append( nChar - nCharsSkipped );
-
/* quote opening */
if ( cQuote.isNull() && stringQuotes.contains( cChar ) )
cQuote = cChar;
@@ -134,9 +131,24 @@
else if ( !cQuote.isNull() && cQuote == cChar )
cQuote = '\0';
+ /* parameter marker */
+ if ( cQuote.isNull() && cChar == cMarker )
+ {
+ listParameterMarkers.append( nChar - nCharsSkipped );
+ if ( !stringSegment.isEmpty() )
+ stringlistSegments.append( stringSegment );
+ stringSegment.clear();
+ stringlistSegments.append( QString( cChar ) );
+ }
+ else
+ stringSegment += cChar;
+
this->stringCommand += cChar;
}
+ if ( !stringSegment.isEmpty() )
+ stringlistSegments.append( stringSegment );
+
this->stringCommand = this->stringCommand.trimmed();
/*!
\todo
Modified: trunk/MYSQLPlus/MYSQLPlusLib/MCommand.h
===================================================================
--- trunk/MYSQLPlus/MYSQLPlusLib/MCommand.h 2006-08-01 00:00:53 UTC (rev 471)
+++ trunk/MYSQLPlus/MYSQLPlusLib/MCommand.h 2006-08-01 07:15:40 UTC (rev 472)
@@ -10,18 +10,7 @@
#define MCOMMAND_H
#include "MInternal.h"
-/*
-#include <MYODBCC.h>
-#include <QList>
-#include <QString>
-#include <QStringList>
-
-class MConnection;
-class MStatement;
-class MDiagnostic;
-*/
-
/*!
\brief A single command (usually a SQL DDL/DML statement) to be sent to the server.
@@ -90,7 +79,7 @@
protected:
/* setters */
- SQLRETURN setCommand( const QString &stringCommand ); // this can include ODBC
and/or server specific syntax
+ SQLRETURN setCommand( const QString &stringCommand ); /*!< this can include
ODBC and/or server specific syntax */
/* getters */
MDiagnostic * getDiagnostic();
| Thread |
|---|
| • Connector/ODBC 5 commit: r472 - trunk/MYSQLPlus/MYSQLPlusLib | pharvey | 1 Aug |