|
/**
Copyright 2000 - 2003 LogicMatrix. All rights reserved.
This software is distributed under the LogicMatrix Free Software License. This software may be used for any purpose, personal or commercial. Redistributions in binary /source code form are permitted. Commercial redistribution of larger works derived from, or works which bundle this software requires a "Commercial Redistribution License" which can be purchased from LogicMatrix. Contact LogicMatrix for details
Redistributions qualify as Free and non-commercial under one of the following terms:
1) Redistributions are made at no charge beyond the reasonable cost of materials and delivery.
2) Redistributions in binary/source code form must reproduce this Copyright Notice,these license terms, and the disclaimer/limitation of liability set forth as below, in the documentation and/or other materials
provided with the distribution.
Disclaimer
==========
The Software is provided on an "AS IS" basis. No warranty is
provided that the Software is free of defects, or fit for a
particular purpose.
Limitation of Liability
=======================
LogicMatrix shall not be liable for any damages suffered by the Licensee or any third party resulting from use of the Software.
**/
/**
cmpr.h
Purpose: base comparion services
Author: Vijay Mathew Pandyalakal
Date: 16/11/2003
Copyright: logicmatrix
**/
#ifndef CMPR_H_
#define CMPR_H_
namespace dsqlm {
class Cmpr {
private:
vector<Column> vct_cols;
vector<ComparissonOperator> vct_coprs; // comparison operators
vector<string> vct_vals; // values to compare
vector<LogicalOperator> vct_loprs; // logical operators
vector<long> vct_cur;
Table *table;
Database* m_db;
public:
Cmpr(Table *table,Database* db,vector<Column> vct_c,
vector<ComparissonOperator> vct_co,vector<string> vct_v,
vector<LogicalOperator> vct_lo);
void run();
bool compare(const char* val1,const char* val2,DsqlType type,ComparissonOperator copr);
long getCursorLength();
long getPos(long idx);
private:
bool equals(const char* val1,const char* val2,DsqlType type);
bool notEquals(const char* val1,const char* val2,DsqlType type);
bool greaterThan(const char* val1,const char* val2,DsqlType type);
bool lesserThan(const char* val1,const char* val2,DsqlType type);
bool greaterThanOrEqualTo(const char* val1,const char* val2,DsqlType type);
bool lesserThanOrEqualTo(const char* val1,const char* val2,DsqlType type);
bool like(const char* val1,const char* val2,DsqlType type);
void removeDuplicates();
};
}
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.