| object-oriented |  |
| realisamdoc overview | ...RealIsam uses the object-oriented technology for a faster and easier development and to simplify the source code. ... |
| object |  |
| realisamdoc constr | ... Define an instance of the object ... |
| realisamdoc constr | .... There is an instance of a realisam object for each database you need in the same program. ... |
| realisamdoc overview | ...Object oriented ... |
| ok |  |
| example start | ...Checked==true) multi=1; else multi=0; strcpy(tmp,"Indexation will delete and rebuild the dictionary, OK ? "); if (Application->MessageBoxA(tmp,"Isam Dictionary",MB_YESNO)==IDNO) return; rc=dict->CloseEngine(); // delete isam files strcpy(tmp,dict_directory);strcat(tmp,"dict.ndx"); ... |
| realisamdoc deleteisam | ...1 OK :... |
| realisamdoc readdirect | ...ReadDirectKey(0,"microsoft",RetKey,&recdata); if (rc) // ok : key found { rc = db->ReadRecord(buffer,recdata); buffer[rc]=0; ............. } else ............ ... |
| realisamdoc readlast | ...ReadLastKey(0,RetKey,&recdata); if (rc) // ok : key is found { rc = db->ReadRecord(buffer,recdata); buffer[rc]=0; ............. } else ............ ... |
| realisamdoc rewriterecord | ...ReadDirectKey(0,"microbiology",RetKey,&recdata); if (rc) //ok { rc = db->ReadRecord(buffer,recdata); // rc is the record length and supposed to be less than 500 .... process data in buffer..... rc = db->RewriteRecord(buffer, strlen(buffer+1),recdata); } ... |
| realisamdoc writerecord | ...WriteKey(0,"microsoft",recdata); if (rc) // key insert ok { db->WriteRecord(buffer,strlen(buffer)+1); ....... } else ............. ... |
| old |  |
| realisamdoc deleteisam | ...for the index and the data file. After deleting these file, It is recommended to create a new database, and not try to access function through the old db pointer. ... |
| realisamdoc deleterecord | ...cisely, rewrite the record with a null data length). The free space is not managed under realisam. It is recommended to write an utility to copy a old database in a new one if there is too many records deleted. ... |
| oldcursor |  |
| example backup | ...X_KEY]; char buffer[BUF_LEN]; char html[BUF_LEN]; char definition[BUF_LEN]; int nbseq,nbisam; struct time t; int nbsec1,nbsec2; TCursor oldCursor = Screen->Cursor; char tmp[250]; char *p,*p1; FILE *fp; strcpy(tmp,"Backup your Data in Text File Dict.txt ? "); if (Application->Mess... |
| example backup | ...Cursor = oldCursor; Beep(); EnableButtons(); Application->MessageBoxA("Backup Done","RealIsam",MB_OK); } //--------------------------------------------------------------------------- ... |
| example duplicate | ...MessageBoxA(tmp,"Isam Dictionary",MB_YESNO)==IDNO) return; TCursor oldCursor = Screen->Cursor; strcpy(name,dict_directory);strcat(name,"dupli.ndx"); rc = unlink (name); strcpy(name,dict_directory);strcat(name,"dupli.dat"); rc =unlink (name); Screen->Cursor = crHourGlass; Disa... |
| example duplicate | ...Cursor = oldCursor; EnableButtons(); Application->MessageBoxA("Duplication Finished","RealIsam",MB_OK); } //--------------------------------------------------------------------------- ... |
| example restore | ...MessageBoxA(tmp,"Restore Dictionary",MB_YESNO)==IDNO) return; TCursor oldCursor = Screen->Cursor; if (cb->Checked==true) multi=1; else multi=0; dict->CloseEngine(); // delete isam files strcpy(name,dict_directory);strcat(name,"dict.ndx"); rc = unlink (name); strcpy(name,dict_direc... |
| example restore | ...Cursor = oldCursor; return; } nbrecords=0; nbisam=0; // read sequential data while (!feof(fp)) { buffer[0]=0; fgets(buffer,BUF_LEN,fp); if (strlen(buffer)>0) { nbisam++; IndexBuffer(buffer); } else nbrecords=nbrecords; ... |
| example restore | ...Cursor = oldCursor; Beep(); EnableButtons(); Application->MessageBoxA("Restoration Done","RealIsam",MB_OK); } //--------------------------------------------------------------------------- ... |
| example start | ...250]; int i; FILE *fp; int rc; char buffer[BUF_LEN]; struct time t; int nbsec1,nbsec2; int hund1,hund2; int nbf; int K; TCursor oldCursor = Screen->Cursor; if (cb->Checked==true) multi=1; else multi=0; strcpy(tmp,"Indexation will delete and rebuild the dictionary, OK ? "); i... |
| example start | ...Cursor = oldCursor; return; } // read sequential data while (!feof(fp)) { tmp[0]=0; fgets(buffer,BUF_LEN,fp); // IndexBuffer(buffer); Application->ProcessMessages(); } fclose(fp); } int nbk = dict->NumberOfKeys(INDEX)... |
| example start | ...Cursor = oldCursor; Beep(); EnableButtons(); Application->MessageBoxA("Indexation Finished","RealIsam",MB_OK); } //--------------------------------------------------------------------------- ... |
| open |  |
| realisamdoc closereopen | ... This function is used to save data, closing the files, and open them again for further processing. ... |
| realisamdoc open | ...Open the index file and the data file associated to the database. The index file, will have the extension specified in the indx parameter,and the data file have the extension specified in the dat parameter. Realisam creates these files if they don't exist. Notice : always open / reopen the data... |
| realisamdoc open | ... parameter,and the data file have the extension specified in the dat parameter. Realisam creates these files if they don't exist. Notice : always open / reopen the database with the same physical block size. ... |
| openengine |  |
| example duplicate | ...OpenEngine(name,120,"ndx","dat"); //120 = 128 - 8 rc = dupli->SetIndexMode(INDEX,multi); // if MULTI == 1 duplicate key allowed // nbrecords=0; nbseq=0; nbisam=0; rc = dict->ReadFirstKey(INDEX,RetKey,&recdata); while (rc) { rc=dict->ReadRecord(buffer,recdata); recdata_dup... |
| example formcreate | ...OpenEngine(name,120,"ndx","dat"); //120 = 128 - 8 multi = dict->GetIndexMode(INDEX); if (multi==0) cb->Checked==false; else cb->Checked=true; // GetVersion Number dict->Version(tmp); MainForm->Caption = "Alpes Software - " + AnsiString(tmp); // Get Number of Keys rc = dict->N... |
| example restore | ...OpenEngine(name,120,"ndx","dat"); //120 = 128 - 8 rc = dict->SetIndexMode(INDEX,multi); // if MULTI == 1 duplicate key allowed rc = dict->SetIndexMode(INDEX+1,multi); nbrecords=0; strcpy(name,dict_directory);strcat(name,"dict.txt"); fp = fopen(name,"r"); if (!fp) {Application->Messa... |
| example start | ...OpenEngine(name,120,"ndx","dat"); //120 = 128 - 8 rc = dict->SetIndexMode(INDEX,multi); // if MULTI == 1 duplicate key allowed rc = dict->SetIndexMode(INDEX+1,multi); nbrecords=0; // read contents of the 1-26 HTML Files (in alphabetic reverse order, just for fun) for (i=nbf;i>=0;i--... |
| index_summary item7 | ...OpenEngine... |
| realisamdoc close | ...OpenEngine("scripts",504,,"ndx","dat"); // 504 + 8 ==> 512 !! if (!rc) { error db2 ... } // end proceesing rc = db1->CloseEngine(); rc = db2->CloseEngine(); ... |
| realisamdoc close | ...OpenEngine("htmlfile",248,"ndx","dat"); // 248 + 8 => 256 ! if (!rc) { error db1 .... } rc = db2->OpenEngine("scripts",504,,"ndx","dat"); // 504 + 8 ==> 512 !! if (!rc) { error db2 ... } // end proceesing rc = db1->CloseEngine(); rc = db2->CloseEngine(); ... |
| realisamdoc deletekey | ...OpenEngine("Applic",504,"ndx","dat"); ................ // end of procedure db->CloseEngine(); ....................... ................. // procedure int rc, recdata; char ReturnKey[100]; rc = db->ReadDirectKey(1,"microsoft",ReturnKey,&recdata); if (rc) { rc=db->DeleteKey(1,... |
| realisamdoc getnew | ...OpenEngine("htmlfile",248,"ndx","dat"); // 248 + 8 => 256 ! if (!rc) { error db1 .... } rc = db1->SetIndexMode(0,UNIQUE_KEY); strcpy(key,"doc30134"); recdata = db1->GetNewRecordNumber(); rc = db1->WriteKey(0,key,recdata); // index 0 if (!rc) { error / duplicate key... } el... |
| realisamdoc include | ...__REALISAM_H #ifdef __cplusplus extern "C" { #endif class _export realisam { public: realisam(void); ~realisam(void); int OpenEngine(char *FileName,short BlockSize,char *ndx, char*dat); int CloseEngine(void); int SetIndexMode(short Index, short Value); int WriteRecor... |
| realisamdoc open | ...OpenEngine... |
| realisamdoc open | ...OpenEngine(char *filename,int datalen, char *indx,char *dat); db is a pointer on the database ... |
| realisamdoc open | ...OpenEngine("htmlfile",248,"ndx","dat"); // 248 + 8 => 256 ! if (!rc) { error db1 .... } rc = db2->OpenEngine("scripts",504,"ndx","dat"); // 504 + 8 ==> 512 !! if (!rc) { error db2 ... } ... |
| realisamdoc open | ...OpenEngine("scripts",504,"ndx","dat"); // 504 + 8 ==> 512 !! if (!rc) { error db2 ... } ... |
| realisamdoc readdirect | ...OpenEngine("Applic",504,"ndx","dat"); ................ db->CloseEngine(); ....................... // procedure int rc; char RetKey[100]; int recdata; rc = db->ReadDirectKey(0,"microsoft",RetKey,&recdata); if (rc) // ok : key found { rc = db->ReadRecord(buffer,recdata); ... |
| realisamdoc readfirst | ...OpenEngine("Applic",504,"ndx","dat"); ................ db->CloseEngine(); ....................... // procedure int rc; char RetKey[100]; int recdata; rc = db->ReadFirstKey(0,RetKey,&recdata); if (rc) // key found { rc = db->ReadRecord(buffer,recdata); buffer[rc]=0; ... |
| realisamdoc readlast | ...OpenEngine("Applic",504,"ndx","dat"); ................ db->CloseEngine(); ....................... // procedure int rc; char RetKey[100]; int recdata; rc = db->ReadLastKey(0,RetKey,&recdata); if (rc) // ok : key is found { rc = db->ReadRecord(buffer,recdata); buffer[r... |
| realisamdoc readnext | ...OpenEngine("Applic",504,"ndx","dat"); ................ // end of processing db->CloseEngine(); ....................... ................. // procedure int rc, recdata; char ReturnKey[100]; // sequentiel reading of an index rc = db->ReadFirstKey(0,ReturnKey,&recdata); while (rc) ... |
| realisamdoc readprev | ...OpenEngine("Applic",504,"ndx","dat"); ................ // end of process db->CloseEngine(); ....................... ................. // procedure int rc, recdata; char ReturnKey[100]; // example : read a file in the reverse order // buffer is supposed to be allocated rc = db->... |
| realisamdoc setindex | ...OpenEngine("htmlfile",248,"ndx","dat"); // 248 + 8 => 256 ! if (!rc) { error db1 .... } rc = db1->SetIndexMode(0,UNIQUE_KEYS); rc = db1->SetIndexMode(1,DUPLICATE_KEYS); rc = db2->OpenEngine("scripts",504,,"ndx","dat"); // 504 + 8 ==> 512 !! rc = db2->SetIndexMode(0,UNIQUE_KEYS); if... |
| realisamdoc setindex | ...OpenEngine("scripts",504,,"ndx","dat"); // 504 + 8 ==> 512 !! rc = db2->SetIndexMode(0,UNIQUE_KEYS); if (!rc) { error db2 ... } // End rc = db1->CloseEngine(); rc = db2->CloseEngine(); ... |
| realisamdoc writekey | ...OpenEngine("htmlfile",248,"ndx","dat"); // 248 + 8 => 256 ! if (!rc) { error db1 .... } rc = db1->SetIndexMode(0,UNIQUE); rc = db1->SetIndexMode(1,DUPLICATE); rc = db2->OpenEngine("scripts",504,"ndx","dat"); // 504 + 8 ==> 512 !! rc = db2->SetIndexMode(0,UNIQUE); if (!rc) { error ... |
| realisamdoc writekey | ...OpenEngine("scripts",504,"ndx","dat"); // 504 + 8 ==> 512 !! rc = db2->SetIndexMode(0,UNIQUE); if (!rc) { error db2 ... } strcpy(key,"doc30134"); recdata = db1->GetNewRecordNumber(); rc = db1->WriteKey(0,key,recdata); // index 0 if (!rc) { error / duplicate key ... } rc = ... |
| realisamdoc writerecord | ...OpenEngine("Applic",504,"ndx","dat"); ................ db->CloseEngine(); ....................... // procedure int rc; char RetKey[100]; int recdata; // new key to insert = "microsoft" // buffer contains the data recdata=db->GetNewRecordNumber(); rc = db->WriteKey(0,"microsoft... |
| opening |  |
| example backup | ...MessageBoxA("Problem Opening Dict.Txt File", "Backup Dictionary",MB_OK); return; } if (cb->Checked==true) multi=1; else multi=0; Screen->Cursor = crHourGlass; strcpy(tmp,lIndex->Caption.c_str()); INDEX=atoi(tmp); DisableButtons(); eWord->Text==... |
| realisamdoc closereopen | ...0 = Error opening files ... |
| realisamdoc open | ...0 = Error at opening files ... |
| opens |  |
| realisamdoc open | ... filename = filename, with no extension (this function opens or creates the Isam files , according the extension required) datalen = Data physical block length . This value is not the real data length, but an average size. realisam will write data in consecutive blocks of datalen + 8 bytes. If re... |
| operation |  |
| example stat | ... Read/Write operations per second, each operation includes the following actions: ... |
| realisamdoc overview | ...ata in numeric, date or text fields : it writes binary or text data according the length specified, and returns all these bytes when a reading operation is required. It is the responsability of the developer to organize records and to know how to extract the fields. Realisam is better adapted ... |
| realisamdoc overview | ...This software is in operation since 1996 in different kind of application : Text Retrieval, CGI Internet, databases to store HTML pages, scripts and HTML macros, XML records, with a very fast access time. Tests were conducted to store million of keys and records associated. ... |
| operations |  |
| example principle | ...Other operations... |
| example stat | ... Read/Write operations per second, each operation includes the following actions: ... |
| option |  |
| example stat | ...-Concatenate definition if No duplicate Key option is set, else store definition in record ... |
| order |  |
| example start | ...SetIndexMode(INDEX+1,multi); nbrecords=0; // read contents of the 1-26 HTML Files (in alphabetic reverse order, just for fun) for (i=nbf;i>=0;i--) // for (i=0;i... |
| realisamdoc open | ... file management system works with multiples of 1024 bytes, and we recommand to work with datalen+8 such as 120 , 248, 504, 1016,2040 ... bytes in order to improve the access time. ... |
| realisamdoc readdirect | ... 0 : Key not found (Retkey contains a key that is the closest key, usually the key before the searched key (in the alphabetic order). 1 : Key found : ReturnKey contains also Key ... |
| realisamdoc readprev | ...(); ....................... ................. // procedure int rc, recdata; char ReturnKey[100]; // example : read a file in the reverse order // buffer is supposed to be allocated rc = db->ReadLast(0,ReturnKey,&recdata); while (rc) { rc = db->ReadRecord(buffer,recdata); ... |
| organize |  |
| realisamdoc overview | ...ccording the length specified, and returns all these bytes when a reading operation is required. It is the responsability of the developer to organize records and to know how to extract the fields. Realisam is better adapted to store variable length text data like XML strings. ... |
| oriented |  |
| realisamdoc overview | ...Object oriented ... |
| over |  |
| realisamdoc readnext | ...rc = 0 : error or empty index, or over end of the index ... |
| overview |  |
| index_summary item2 | ...Overview... |
| realisamdoc overview | ...OVERVIEW... |
| owner |  |
| example include | ... void __fastcall EnableButtons(); void __fastcall DisableButtons(); public: // User declarations __fastcall TMainForm(TComponent* Owner); }; //--------------------------------------------------------------------------- extern PACKAGE TMainForm *MainForm; //---------------------... |
| example main_header | ... TMainForm *MainForm; //--------------------------------------------------------------------------- __fastcall TMainForm::TMainForm(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- ... |
| example main_header | ...//--------------------------------------------------------------------------- __fastcall TMainForm::TMainForm(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- ... |