BOOL WINAPI DllMain(HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved) { conditionsInfos = getConditionInfos(); actionsInfos = getActionInfos(); expressionsInfos = getExpressionInfos(); ConditionJumps = getConditions(); ActionJumps = getActions(); ExpressionJumps = getExpressions(); switch (dwReason) { // DLL is attaching to the address space of the current process. case DLL_PROCESS_ATTACH: hInstLib = hDLL; // Store HINSTANCE break; // A new thread is being created in the current process. case DLL_THREAD_ATTACH: break; // A thread is exiting cleanly. case DLL_THREAD_DETACH: break; // The calling process is detaching the DLL from its address space. case DLL_PROCESS_DETACH: break; } return TRUE; }
std::string &uSQL::SQLOperator::toString(std::string &buf) { uSQL::SQLExpression *firstExpr = getLeftExpression(); std::ostringstream oss; std::string exprBuf; if (firstExpr) oss << firstExpr->toString(exprBuf) << " "; std::string operStr; switch (getValue()) { case SEQ: operStr = "="; break; case DEQ: operStr = "=="; break; case NOTEQ: operStr = "!="; break; case LT: operStr = "<"; break; case LE: operStr = "<="; break; case GT: operStr = ">"; break; case GE: operStr = ">="; break; case AND: operStr = "AND"; break; case OR: operStr = "OR"; break; default: operStr = "?"; break; } uSQL::SQLNodeList *expressions = getExpressions(); std::size_t expressionCnt = expressions->size(); for (std::size_t n=1; n <expressionCnt; n++) { uSQL::SQLNode *exprNode = expressions->at(n); oss << operStr << " " << exprNode->toString(exprBuf); } buf = oss.str(); return buf; }