/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Calibration/rdbModel/rdbModel-00-01-01/src/Db/MysqlConnection.cxx File Reference

#include "rdbModel/Db/MysqlConnection.h"
#include "rdbModel/Rdb.h"
#include "rdbModel/Tables/Table.h"
#include "rdbModel/Tables/Assertion.h"
#include "rdbModel/Tables/Column.h"
#include "rdbModel/Tables/Datatype.h"
#include "rdbModel/Db/MysqlResults.h"
#include "rdbModel/RdbException.h"
#include "facilities/Util.h"
#include "xmlBase/XmlParser.h"
#include "xmlBase/Dom.h"
#include "mysql.h"
#include <iostream>
#include <stdio.h>
#include <unistd.h>

Go to the source code of this file.

Namespaces

namespace  rdbModel

Functions

int extractSize (const std::string &sqlString)
void addArg (bool literal, const std::string arg, std::string &sqlString)
bool compareEnumList (const std::vector< std::string > &choices, std::string sqlType)

Variables

std::string rdbModel::opSymbols [OPTYPElast]


Function Documentation

void @1::addArg ( bool  literal,
const std::string  arg,
std::string sqlString 
) [static]

Definition at line 41 of file MysqlConnection.cxx.

Referenced by rdbModel::MysqlConnection::compileComparison().

00041                                                                        {
00042     if (literal) sqlString += '"';
00043     sqlString += arg;
00044     if (literal) sqlString += '"';
00045     return;
00046   }

bool @1::compareEnumList ( const std::vector< std::string > &  choices,
std::string  sqlType 
) [static]

Definition at line 48 of file MysqlConnection.cxx.

References RealDBUtil::npos.

Referenced by rdbModel::MysqlConnection::checkDType().

00049                                           {
00050     // Number has to be the same.  
00051     std::string::size_type locComma = sqlType.find(",");
00052     unsigned nComma = 0;
00053     while (locComma != std::string::npos) {
00054       nComma++;
00055       locComma = sqlType.find(",", locComma+1);
00056     }
00057     unsigned nChoice = choices.size();
00058     if (nChoice != (nComma + 1)) return false;
00059     for (unsigned iChoice = 0; iChoice < nChoice; iChoice++) {
00060       std::string::size_type loc = sqlType.find(choices[iChoice]);
00061       if (loc == std::string::npos) return false;
00062     }
00063     return true;
00064   }

int @1::extractSize ( const std::string sqlString  )  [static]

Definition at line 28 of file MysqlConnection.cxx.

References RealDBUtil::npos, and deljobs::string.

Referenced by rdbModel::MysqlConnection::checkDType().

00028                                               {
00029     std::string::size_type leftLoc = sqlString.find("(");
00030     if (leftLoc == std::string::npos) return 0;
00031     leftLoc++;           // now is at start of m
00032     std::string::size_type rightLoc = sqlString.find(",");
00033     if (rightLoc == std::string::npos) {
00034       rightLoc = sqlString.find(")");
00035     }
00036     std::string numString = 
00037       sqlString.substr(leftLoc, rightLoc - leftLoc);
00038     return facilities::Util::stringToInt(numString);
00039   }


Generated on Tue Nov 29 23:14:52 2016 for BOSS_7.0.2 by  doxygen 1.4.7