*** empty log message ***
This commit is contained in:
parent
11f9aa4fcb
commit
f796ed6d91
3 changed files with 42 additions and 72 deletions
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: Block.cxx,v $
|
||||
*
|
||||
* $Revision: 1.1 $
|
||||
* $Revision: 1.2 $
|
||||
*
|
||||
* last change: $Author: abi $ $Date: 2001-05-08 11:54:54 $
|
||||
* last change: $Author: abi $ $Date: 2001-05-10 15:25:10 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -85,6 +85,7 @@ Block::Block( const DBEnv* dbenv )
|
|||
isLeaf_( true ),
|
||||
free_( 0 ),
|
||||
num_( 0 ),
|
||||
dataL_( dbenv->getDataLen() ),
|
||||
data_( new sal_Int8[ dbenv->getDataLen() ] )
|
||||
{
|
||||
}
|
||||
|
@ -138,7 +139,8 @@ sal_Int32 Block::getInteger( sal_Int32 i ) const throw( excep::IllegalIndexExcep
|
|||
throw excep::IllegalIndexException(
|
||||
rtl::OUString::createFromAscii( "Block::setInteger -> index out of range" ) );
|
||||
|
||||
return ::getInteger_( &data_[i] );
|
||||
sal_Int32 ret = ::getInteger_( &data_[i] );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: BtreeDict.cxx,v $
|
||||
*
|
||||
* $Revision: 1.1 $
|
||||
* $Revision: 1.2 $
|
||||
*
|
||||
* last change: $Author: abi $ $Date: 2001-05-08 11:54:54 $
|
||||
* last change: $Author: abi $ $Date: 2001-05-10 15:25:10 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -262,11 +262,11 @@ namespace xmlsearch {
|
|||
}
|
||||
|
||||
|
||||
void setBlockNumbers( sal_Int32* blocks )
|
||||
{
|
||||
for( sal_Int32 e = firstEntry(); e < getFree() ; e = nextEntry(e) )
|
||||
blocks[ entryID(e) ] = getNum();
|
||||
}
|
||||
void setBlockNumbers( sal_Int32* blocks );
|
||||
// {
|
||||
// for( sal_Int32 e = firstEntry(); e < getFree() ; e = nextEntry(e) )
|
||||
// blocks[ entryID(e) ] = getNum();
|
||||
// }
|
||||
|
||||
|
||||
#ifdef ABIDEBUG
|
||||
|
@ -328,6 +328,12 @@ namespace xmlsearch {
|
|||
|
||||
|
||||
|
||||
void DictBlock::setBlockNumbers( sal_Int32* blocks )
|
||||
{
|
||||
for( sal_Int32 e = firstEntry(); e < getFree() ; e = nextEntry(e) )
|
||||
blocks[ entryID(e) ] = getNum();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -344,34 +350,36 @@ using namespace xmlsearch::util;
|
|||
|
||||
|
||||
class BlockProcessorImpl
|
||||
: public BlockProcessor
|
||||
: public BlockProcessor
|
||||
{
|
||||
public:
|
||||
|
||||
BlockProcessorImpl( BtreeDict* bla )
|
||||
: bla_( bla )
|
||||
{
|
||||
}
|
||||
BlockProcessorImpl( BtreeDict* bla )
|
||||
: bla_( bla )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
~BlockProcessorImpl()
|
||||
{
|
||||
}
|
||||
~BlockProcessorImpl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void process( Block* block ) const
|
||||
{
|
||||
dynamic_cast<DictBlock*>(block)->setBlockNumbers( bla_->get_blocks() );
|
||||
}
|
||||
|
||||
void process( Block* block ) const;
|
||||
|
||||
private:
|
||||
|
||||
BtreeDict* bla_;
|
||||
BtreeDict* bla_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
void BlockProcessorImpl::process( Block* block ) const
|
||||
{
|
||||
DictBlock* bla = dynamic_cast<DictBlock*>( block );
|
||||
bla->setBlockNumbers( bla_->get_blocks() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
BtreeDict::BtreeDict( DBEnv* dbenv )
|
||||
|
@ -393,7 +401,8 @@ BtreeDict::~BtreeDict()
|
|||
|
||||
const DictBlock* BtreeDict::accessBlock( sal_Int32 id ) const
|
||||
{
|
||||
return dynamic_cast< const DictBlock* >( blockManager_.accessBlock( id ) );
|
||||
const Block* bl = blockManager_.accessBlock( id );
|
||||
return dynamic_cast< const DictBlock* >( bl );
|
||||
}
|
||||
|
||||
|
||||
|
@ -609,43 +618,3 @@ void DBEnvImpl::write( sal_Int32 blNum,xmlsearch::db::Block* block )
|
|||
|
||||
|
||||
|
||||
|
||||
void bla()
|
||||
{
|
||||
BtreeDict source( new DBEnvImpl() );
|
||||
|
||||
std::vector< sal_Int32 > bla = source.withPrefix( rtl::OUString::createFromAscii( "text" ) );
|
||||
for( sal_uInt32 i = 0; i < bla.size(); ++i )
|
||||
; // cout << bla[i] << endl;
|
||||
|
||||
// source.test();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef ABIDEBUG
|
||||
|
||||
#include <qe/QueryProcessor.hxx>
|
||||
|
||||
|
||||
void blu()
|
||||
{
|
||||
rtl::OUString indexDir = rtl::OUString::createFromAscii( "//./home/ab106281/work/index" );
|
||||
qe::QueryProcessor proc( indexDir );
|
||||
|
||||
vector< rtl::OUString > bla(1);
|
||||
|
||||
bla[ 0 ] = rtl::OUString::createFromAscii( "text" );
|
||||
rtl::OUString scope = rtl::OUString::createFromAscii( "headingheading" );
|
||||
sal_Int32 nHits = 100;
|
||||
|
||||
qe::QueryStatement statement( nHits,
|
||||
bla,
|
||||
scope );
|
||||
|
||||
proc.processQuery( statement );
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
#
|
||||
# $RCSfile: makefile.mk,v $
|
||||
#
|
||||
# $Revision: 1.1 $
|
||||
# $Revision: 1.2 $
|
||||
#
|
||||
# last change: $Author: abi $ $Date: 2001-05-08 11:54:54 $
|
||||
# last change: $Author: abi $ $Date: 2001-05-10 15:25:10 $
|
||||
#
|
||||
# The Contents of this file are made available subject to the terms of
|
||||
# either of the following licenses
|
||||
|
@ -70,20 +70,19 @@ ENABLE_EXCEPTIONS=TRUE
|
|||
|
||||
# --- Settings -----------------------------------------------------
|
||||
|
||||
.INCLUDE : svpre.mk
|
||||
.INCLUDE : settings.mk
|
||||
.INCLUDE : sv.mk
|
||||
|
||||
.IF "$(GUI)"=="WNT"
|
||||
CFLAGS+=/GR
|
||||
.ENDIF
|
||||
|
||||
# --- Files --------------------------------------------------------
|
||||
|
||||
.IF "$(header)" == ""
|
||||
|
||||
SLOFILES=\
|
||||
$(SLO)$/Block.obj \
|
||||
$(SLO)$/BlockManager.obj \
|
||||
$(SLO)$/BtreeDict.obj \
|
||||
$(SLO)$/Schema.obj
|
||||
.ENDIF
|
||||
|
||||
# --- Targets ------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Reference in a new issue