Click here to Skip to main content
Click here to Skip to main content
Articles » Database » Database » General » Downloads
 
Add your own
alternative version
Go to top

DarkSide SQL Mini Version 1, The embedded database

, 23 Mar 2006
An embedded database library in C++.
/**
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.


**/

/**
	rec.h

	Purpose: Defines classes to records on disk

	Author: Vijay Mathew Pandyalakal
	Date:	14/11/2003
	Copyright: logicmatrix
**/

#ifndef REC_H_
#define REC_H_


namespace dsqlm {

	class Rec {
	private:
		Table* table;
		Database* m_db;
		string buffer; // a record on disk
		vector<int> field_pos;		
		
		// variables for sequential access
		long seq_rec;
		long seq_file_len;
		bool seq_open;
		int seq_rec_len;
	public:
		Rec(Table *table,Database* db);
		~Rec();
		void write(long pos = -1);
		void read(long pos);
		void appendField(int col_num,const char* data,char* ret);
		void updateField(int col_num,const char* data,char* ret);
		string getField(int col_num);
		void del();
		void del(long pos);

		long fileLength();
		int recLength();

		// functions for sequential access of records
		void openCursor();
		bool next(long* ret_pos);
		void closeCursor();

		// record related functions
		bool isDeleted();
		bool isDeleted(long pos);
		bool isNull(int col_num);
		long optimize();
	private:
		int initBuffer();
	};

}
#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.

License

This article, along with any associated source code and files, is licensed under The BSD License

Share

About the Author

No Biography provided

| Advertise | Privacy | Mobile
Web03 | 2.8.140905.1 | Last Updated 23 Mar 2006
Article Copyright 2003 by AnOldGreenHorn
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid