📄 database.hpp
字号:
//// This file is part of the "More for C++" library//// Copyright (c) 1999-2003 by Thorsten Goertz (thorsten@morefor.org)//// The "More for C++" library is free software; you can redistribute it and/or// modify it under the terms of the license that comes with this package.//// Read "license.txt" for more details.//// THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED// WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES// OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.////////////////////////////////////////////////////////////////////////////////#ifndef MORE_SQL_DATABASE_HPP#define MORE_SQL_DATABASE_HPP////////////////////////////////////////////////////////////////////////////////#include <more/exception.hpp>#include <more/numbers.hpp>#include <more/pointer.hpp>#include <more/stl.hpp>#include <more/string.hpp>#include <more/io/streams.hpp>////////////////////////////////////////////////////////////////////////////////namespace more{ namespace sql { class Database { public: class Exception: public more::Exception { }; class Value; typedef more::stl::Map<String, p<Value> > Record; class Session { public: virtual void begin( ) throw( Exception ) = 0; virtual void commit( ) throw( Exception ) = 0; virtual void rollback( ) throw( Exception ) = 0; virtual void execute( const String& sStatement ) throw( Exception ) = 0; virtual void updateBlob( const String& sName, const p<more::io::InputStream>& ) throw( Exception ) = 0; virtual p<Record> fetch( ) throw( Exception ) = 0; protected: virtual ~Session( ); }; virtual p<Session> createSession( ) throw( Exception ) = 0; class Date; class Value { public: virtual operator signed8 ( ) throw( Exception ) = 0; virtual operator unsigned8 ( ) throw( Exception ) = 0; virtual operator signed16 ( ) throw( Exception ) = 0; virtual operator unsigned16 ( ) throw( Exception ) = 0; virtual operator signed32 ( ) throw( Exception ) = 0; virtual operator unsigned32 ( ) throw( Exception ) = 0; virtual operator float ( ) throw( Exception ) = 0; virtual operator double ( ) throw( Exception ) = 0; virtual operator String ( ) throw( Exception ) = 0; virtual operator p<Date>( ) throw( Exception ) = 0; virtual operator p<more::io::InputStream> ( ) throw( Exception ) = 0; protected: virtual ~Value( ); }; class Date { public: static p<Date> create( size_t nSeconds ); // since 1.1.1970 00:00 static p<Date> create( const String& ); virtual operator size_t ( ) = 0; virtual operator String ( ) = 0; protected: virtual ~Date( ); }; protected: virtual ~Database( ); }; }}////////////////////////////////////////////////////////////////////////////////#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -