summaryrefslogtreecommitdiff
path: root/xmlhelp/source/cxxhelp/provider/db.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmlhelp/source/cxxhelp/provider/db.hxx')
-rwxr-xr-x[-rw-r--r--]xmlhelp/source/cxxhelp/provider/db.hxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/db.hxx b/xmlhelp/source/cxxhelp/provider/db.hxx
index eb867c0426d3..1e25ab1f579b 100644..100755
--- a/xmlhelp/source/cxxhelp/provider/db.hxx
+++ b/xmlhelp/source/cxxhelp/provider/db.hxx
@@ -118,7 +118,7 @@ namespace berkeleydbproxy {
class DBHelp
{
- rtl::OUString m_aFileName;
+ rtl::OUString m_aFileURL;
StringToDataMap* m_pStringToDataMap;
StringToValPosMap* m_pStringToValPosMap;
com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess >
@@ -133,16 +133,21 @@ namespace berkeleydbproxy {
bool implReadLenAndData( const char* pData, int& riPos, DBData& rValue );
public:
- DBHelp( const rtl::OUString& rFileName,
+ //DBHelp must get a fileURL which can then directly be used by simple file access.
+ //SimpleFileAccess requires file URLs as arguments. Passing file path may work but fails
+ //for example when using long file paths on Windows, which start with "\\?\"
+ DBHelp( const rtl::OUString& rFileURL,
com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess > xSFA )
- : m_aFileName( rFileName )
+ : m_aFileURL( rFileURL )
, m_pStringToDataMap( NULL )
, m_pStringToValPosMap( NULL )
, m_xSFA( xSFA )
, m_pItData( NULL )
, m_nItRead( -1 )
, m_iItPos( -1 )
- {}
+ {
+ OSL_ASSERT(!rFileURL.compareTo(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:")), 5));
+ }
~DBHelp()
{ releaseHashMap(); }
@@ -150,7 +155,7 @@ namespace berkeleydbproxy {
void releaseHashMap( void );
#ifdef TEST_DBHELP
- bool testAgainstDb( const rtl::OString& fileName, bool bOldDbAccess );
+ bool testAgainstDb( const rtl::OUString& fileURL, bool bOldDbAccess );
#endif
bool getValueForKey( const rtl::OString& rKey, DBData& rValue );
@@ -184,6 +189,12 @@ namespace berkeleydbproxy {
u_int32_t flags,
int mode);
+ int open(DB_TXN *txnid,
+ ::rtl::OUString const & fileURL,
+ DBTYPE type,
+ u_int32_t flags,
+ int mode);
+
int get(DB_TXN* txnid, Dbt *key, Dbt *data, u_int32_t flags);