mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
1. Fix work with big index files
2. Increase limit of node elements while build index
This commit is contained in:
parent
9fb467abf3
commit
968690654f
|
@ -49,7 +49,7 @@ using std::pair;
|
|||
enum
|
||||
{
|
||||
BtreeMinElements = 64,
|
||||
BtreeMaxElements = 5120
|
||||
BtreeMaxElements = 8192
|
||||
};
|
||||
|
||||
BtreeIndex::BtreeIndex():
|
||||
|
|
10
file.cc
10
file.cc
|
@ -239,7 +239,7 @@ std::string Class::gets( bool stripNl ) THROW_SPEC( exReadError, exWriteError )
|
|||
return std::string( buf );
|
||||
}
|
||||
|
||||
void Class::seek( long offset ) THROW_SPEC( exSeekError, exWriteError )
|
||||
void Class::seek( qint64 offset ) THROW_SPEC( exSeekError, exWriteError )
|
||||
{
|
||||
if ( writeBuffer )
|
||||
flushWriteBuffer();
|
||||
|
@ -248,7 +248,7 @@ void Class::seek( long offset ) THROW_SPEC( exSeekError, exWriteError )
|
|||
throw exSeekError();
|
||||
}
|
||||
|
||||
void Class::seekCur( long offset ) THROW_SPEC( exSeekError, exWriteError )
|
||||
void Class::seekCur( qint64 offset ) THROW_SPEC( exSeekError, exWriteError )
|
||||
{
|
||||
if ( writeBuffer )
|
||||
flushWriteBuffer();
|
||||
|
@ -257,7 +257,7 @@ void Class::seekCur( long offset ) THROW_SPEC( exSeekError, exWriteError )
|
|||
throw exSeekError();
|
||||
}
|
||||
|
||||
void Class::seekEnd( long offset ) THROW_SPEC( exSeekError, exWriteError )
|
||||
void Class::seekEnd( qint64 offset ) THROW_SPEC( exSeekError, exWriteError )
|
||||
{
|
||||
if ( writeBuffer )
|
||||
flushWriteBuffer();
|
||||
|
@ -271,7 +271,7 @@ void Class::rewind() THROW_SPEC( exSeekError, exWriteError )
|
|||
seek( 0 );
|
||||
}
|
||||
|
||||
size_t Class::tell() THROW_SPEC( exSeekError )
|
||||
qint64 Class::tell() THROW_SPEC( exSeekError )
|
||||
{
|
||||
qint64 result = f.pos();
|
||||
|
||||
|
@ -281,7 +281,7 @@ size_t Class::tell() THROW_SPEC( exSeekError )
|
|||
if ( writeBuffer )
|
||||
result += ( WriteBufferSize - writeBufferLeft );
|
||||
|
||||
return ( size_t ) result;
|
||||
return result;
|
||||
}
|
||||
|
||||
bool Class::eof() THROW_SPEC( exWriteError )
|
||||
|
|
8
file.hh
8
file.hh
|
@ -95,17 +95,17 @@ public:
|
|||
std::string gets( bool stripNl = true ) THROW_SPEC( exReadError, exWriteError );
|
||||
|
||||
/// Seeks in the file, relative to its beginning.
|
||||
void seek( long offset ) THROW_SPEC( exSeekError, exWriteError );
|
||||
void seek( qint64 offset ) THROW_SPEC( exSeekError, exWriteError );
|
||||
/// Seeks in the file, relative to the current position.
|
||||
void seekCur( long offset ) THROW_SPEC( exSeekError, exWriteError );
|
||||
void seekCur( qint64 offset ) THROW_SPEC( exSeekError, exWriteError );
|
||||
/// Seeks in the file, relative to the end of file.
|
||||
void seekEnd( long offset = 0 ) THROW_SPEC( exSeekError, exWriteError );
|
||||
void seekEnd( qint64 offset = 0 ) THROW_SPEC( exSeekError, exWriteError );
|
||||
|
||||
/// Seeks to the beginning of file
|
||||
void rewind() THROW_SPEC( exSeekError, exWriteError );
|
||||
|
||||
/// Tells the current position within the file, relative to its beginning.
|
||||
size_t tell() THROW_SPEC( exSeekError );
|
||||
qint64 tell() THROW_SPEC( exSeekError );
|
||||
|
||||
/// Returns true if end-of-file condition is set.
|
||||
bool eof() THROW_SPEC( exWriteError );
|
||||
|
|
Loading…
Reference in a new issue