|
#pragma once
#include "ForwardDeclares.h"
#include <string>
class CLongBinary;
namespace TemplateDB
{
class SQLBool;
class SQLLong;
class SQLDouble;
class SQLString;
class SQLBinary;
class SQLValue
{
public:
SQLValue();
SQLValue( const SQLValue &src );
SQLValue &operator=( const SQLValue &rhs );
virtual ~SQLValue();
virtual SQLValue *Clone() const = 0;
bool IsNull() const;
void SetNull( bool isNull );
std::string GetSQLValue() const;
virtual std::string GetValueAsString() const = 0;
virtual operator bool() const;
virtual operator long() const;
virtual operator double() const;
virtual operator std::string() const;
virtual operator const CLongBinary*() const;
virtual void SetBoolValue( bool value );
virtual void SetLongValue( long value );
virtual void SetDoubleValue( double value );
virtual void SetStringValue( const std::string &value );
virtual void SetBinaryValue( const CLongBinary &value );
virtual bool operator==( const SQLValue &other ) const;
// Dynamic Parameter Binding - default to requiring no binding
virtual bool RequiresDynamicBinding() const;
virtual const SQLParameterBinderPtr GetParameterBinder() const;
protected:
SQLValue( bool isNULL );
private:
bool m_isNull;
static const std::string m_nullValue;
};
} // namespace TemplateDB
|
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 article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
I started programming on 8 bit machines as a teenager, writing my first compiled programming language before I was 16. I went on to study Engineering and Computer Science at Oxford University, getting a first and the University Prize for the best results in Computer Science. Since then I have worked in a variety of roles, involving systems management and development management on a wide variety of platforms. Now I manage a software development company producing CAD software for Windows using C++.
My 3 favourite reference books are: Design Patterns, Gamma et al; The C++ Standard Library, Josuttis; and Computer Graphics, Foley et al.
Outside computers, I am also the drummer in a band, The Unbelievers and we have just released our first album. I am a pretty good juggler and close up magician, and in my more insane past, I have cycled from Spain to Eastern Turkey, and cycled across the Namib desert.