20#ifndef INCLUDED_OOX_DUMP_DUMPERBASE_HXX
21#define INCLUDED_OOX_DUMP_DUMPERBASE_HXX
32#include <com/sun/star/uno/Reference.hxx>
33#include <com/sun/star/uno/Sequence.hxx>
34#include <com/sun/star/util/DateTime.hpp>
38#include <rtl/string.hxx>
39#include <rtl/textenc.h>
40#include <rtl/ustring.hxx>
41#include <rtl/ustrbuf.hxx>
47 namespace io {
class XInputStream; }
48 namespace io {
class XOutputStream; }
49 namespace io {
class XTextOutputStream2; }
50 namespace uno {
class XComponentContext; }
54 class TextInputStream;
67#define OOX_DUMP_ERRASCII( ascii ) "?err:" ascii
69#define OOX_DUMP_ERR_NOMAP "no-map"
71#define OOX_DUMP_ERR_STREAM "stream-error"
73#define OOX_DUMP_DUMPEXT ".dump"
110 static css::uno::Reference< css::io::XInputStream >
112 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
113 const OUString& rFileName );
117 static css::uno::Reference< css::io::XOutputStream >
119 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
120 const OUString& rFileName );
122 static css::uno::Reference< css::io::XTextOutputStream2 >
124 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
125 const css::uno::Reference< css::io::XOutputStream >& rxOutStrm,
126 rtl_TextEncoding eTextEnc );
128 static css::uno::Reference< css::io::XTextOutputStream2 >
130 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
131 const OUString& rFileName,
132 rtl_TextEncoding eTextEnc );
147 template<
typename StreamType >
250 static void appendString( OUStringBuffer& rStr, std::u16string_view rData, sal_Int32 nWidth,
sal_Unicode cFill =
' ' );
256 static void appendDec( OUStringBuffer& rStr, sal_uInt16 nData, sal_Int32 nWidth = 0,
sal_Unicode cFill =
' ' );
257 static void appendDec( OUStringBuffer& rStr, sal_Int16 nData, sal_Int32 nWidth = 0,
sal_Unicode cFill =
' ' );
258 static void appendDec( OUStringBuffer& rStr, sal_uInt32 nData, sal_Int32 nWidth = 0,
sal_Unicode cFill =
' ' );
259 static void appendDec( OUStringBuffer& rStr, sal_Int32 nData, sal_Int32 nWidth = 0,
sal_Unicode cFill =
' ' );
260 static void appendDec( OUStringBuffer& rStr, sal_uInt64 nData, sal_Int32 nWidth = 0,
sal_Unicode cFill =
' ' );
261 static void appendDec( OUStringBuffer& rStr, sal_Int64 nData, sal_Int32 nWidth = 0,
sal_Unicode cFill =
' ' );
262 static void appendDec( OUStringBuffer& rStr,
double fData, sal_Int32 nWidth = 0,
sal_Unicode cFill =
' ' );
267 static void appendHex( OUStringBuffer& rStr,
sal_Int8 nData,
bool bPrefix =
true );
268 static void appendHex( OUStringBuffer& rStr, sal_uInt16 nData,
bool bPrefix =
true );
269 static void appendHex( OUStringBuffer& rStr, sal_Int16 nData,
bool bPrefix =
true );
270 static void appendHex( OUStringBuffer& rStr, sal_uInt32 nData,
bool bPrefix =
true );
271 static void appendHex( OUStringBuffer& rStr, sal_Int32 nData,
bool bPrefix =
true );
272 static void appendHex( OUStringBuffer& rStr, sal_uInt64 nData,
bool bPrefix =
true );
273 static void appendHex( OUStringBuffer& rStr, sal_Int64 nData,
bool bPrefix =
true );
274 static void appendHex( OUStringBuffer& rStr,
double fData,
bool bPrefix =
true );
280 static void appendShortHex( OUStringBuffer& rStr, sal_uInt16 nData,
bool bPrefix =
true );
281 static void appendShortHex( OUStringBuffer& rStr, sal_Int16 nData,
bool bPrefix =
true );
282 static void appendShortHex( OUStringBuffer& rStr, sal_uInt32 nData,
bool bPrefix =
true );
283 static void appendShortHex( OUStringBuffer& rStr, sal_Int32 nData,
bool bPrefix =
true );
284 static void appendShortHex( OUStringBuffer& rStr, sal_uInt64 nData,
bool bPrefix =
true );
285 static void appendShortHex( OUStringBuffer& rStr, sal_Int64 nData,
bool bPrefix =
true );
286 static void appendShortHex( OUStringBuffer& rStr,
double fData,
bool bPrefix =
true );
291 static void appendBin( OUStringBuffer& rStr,
sal_Int8 nData,
bool bDots =
true );
292 static void appendBin( OUStringBuffer& rStr, sal_uInt16 nData,
bool bDots =
true );
293 static void appendBin( OUStringBuffer& rStr, sal_Int16 nData,
bool bDots =
true );
294 static void appendBin( OUStringBuffer& rStr, sal_uInt32 nData,
bool bDots =
true );
295 static void appendBin( OUStringBuffer& rStr, sal_Int32 nData,
bool bDots =
true );
296 static void appendBin( OUStringBuffer& rStr, sal_uInt64 nData,
bool bDots =
true );
297 static void appendBin( OUStringBuffer& rStr, sal_Int64 nData,
bool bDots =
true );
298 static void appendBin( OUStringBuffer& rStr,
double fData,
bool bDots =
true );
302 template<
typename Type >
303 static void appendFix( OUStringBuffer& rStr,
Type nData, sal_Int32 nWidth = 0 );
307 static void appendBool( OUStringBuffer& rStr,
bool bData );
308 template<
typename Type >
315 static void appendEncString( OUStringBuffer& rStr, std::u16string_view rData,
bool bPrefix =
true );
321 static void appendIndex( OUStringBuffer& rStr, sal_Int64 nIdx );
330 static std::u16string_view
trimSpaces( std::u16string_view rStr );
337 static bool convertFromDec( sal_Int64& ornData, std::u16string_view rData );
338 static bool convertFromHex( sal_Int64& ornData, std::u16string_view rData );
353template<
typename Type >
356 appendDec( rStr,
static_cast< double >( nData ) / std::pow( 2.0, 4.0 *
sizeof(
Type ) ), nWidth );
359template<
typename Type >
379 String(
const OUString& rStr ) : OUString( rStr ) {}
380 String(
const char* pcStr ) : OUString( OUString::createFromAscii( pcStr ? pcStr :
"" ) ) {}
384 OUString
operator()(
const char* pcDefault )
const {
if(
has() )
return *
this;
return String( pcDefault ); }
450 static bool isValid(
const std::shared_ptr< Base >& rxBase ) {
return rxBase && rxBase->isValid(); }
470 const OUString& rKey,
471 const OUString& rData );
476 const OUString& rData );
491 const OUString& rKey,
492 const OUString& rData );
496class SharedConfigData;
526 template<
typename Type >
528 {
return maMap.count(
static_cast< sal_Int64
>( nKey ) ) != 0; }
531 template<
typename Type >
533 {
return implGetName( rCfg,
static_cast< sal_Int64
>( nKey ) ); }
551 const OUString& rKey,
552 const OUString& rData )
override;
557 const OUString& rData )
override;
560 virtual void implSetName( sal_Int64 nKey,
const OUString& rName ) = 0;
571 const OUString*
findRawName( sal_Int64 nKey )
const;
575 void include( std::u16string_view rListKeys );
577 void exclude( std::u16string_view rKeys );
596 const OUString& rKey,
597 const OUString& rData )
override;
600 virtual void implSetName( sal_Int64 nKey,
const OUString& rName )
override;
602 virtual OUString
implGetName(
const Config& rCfg, sal_Int64 nKey )
const override;
624 const OUString& rKey,
625 const OUString& rData )
override;
627 virtual void implSetName( sal_Int64 nKey,
const OUString& rName )
override;
647 const OUString& rKey,
648 const OUString& rData )
override;
651 virtual void implSetName( sal_Int64 nKey,
const OUString& rName )
override;
653 virtual OUString
implGetName(
const Config& rCfg, sal_Int64 nKey )
const override;
671 virtual void implSetName( sal_Int64 nKey,
const OUString& rName )
override;
673 virtual OUString
implGetName(
const Config& rCfg, sal_Int64 nKey )
const override;
706 virtual void implSetName( sal_Int64 nKey,
const OUString& rName )
override;
708 virtual OUString
implGetName(
const Config& rCfg, sal_Int64 nKey )
const override;
742 ::std::map< sal_Int64, ItemFormat >
maMap;
748 ::std::map< sal_Int64, ItemFormat >::const_iterator
end()
const {
return maMap.end(); }
749 ::std::map< sal_Int64, ItemFormat >::const_iterator
find(sal_Int64
nId)
const
762 const OUString& rFileName,
763 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
765 OUString aSysFileName );
773 const OUString*
getOption(
const OUString& rKey )
const;
775 template<
typename ListType >
776 std::shared_ptr< ListType >
createNameList(
const OUString& rListName );
785 const OUString& rKey,
786 const OUString& rData )
override;
790 template<
typename ListType >
800 css::uno::Reference< css::uno::XComponentContext >
mxContext;
811template<
typename ListType >
814 std::shared_ptr< ListType > xList;
815 if( !rListName.isEmpty() )
817 xList = std::make_shared<ListType>( *
this );
823template<
typename ListType >
826 NameListRef xList = createNameList< ListType >( rListName );
828 xList->readConfigBlock(
rStrm );
836 const char* pcEnvVar,
837 const ::oox::core::FilterBase& rFilter );
839 const char* pcEnvVar,
840 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
842 const OUString& rSysFileName );
851 const css::uno::Reference< css::uno::XComponentContext >&
getContext()
const {
return mxCfgData->getContext(); }
857 template<
typename Type >
863 template<
typename ListType >
869 template<
typename Type >
872 template<
typename Type >
878 const char* pcEnvVar,
879 const ::oox::core::FilterBase& rFilter );
881 const char* pcEnvVar,
882 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
884 const OUString& rSysFileName );
896template<
typename Type >
902 static_cast< Type >( nRawData ) : nDefault;
905template<
typename ListType >
908 return mxCfgData->createNameList< ListType >( rListName );
911template<
typename Type >
918template<
typename Type >
922 return xList.get() && xList->hasName( nKey );
930 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
931 const OUString& rFileName );
941 void startTable( sal_Int32 nW1, sal_Int32 nW2 );
942 void startTable( sal_Int32 nW1, sal_Int32 nW2, sal_Int32 nW3, sal_Int32 nW4 );
943 void startTable(
size_t nColCount,
const sal_Int32* pnColWidths );
945 void tab(
size_t nCol );
963 template<
typename Type >
966 template<
typename Type >
969 template<
typename Type >
972 template<
typename Type >
975 template<
typename Type >
978 template<
typename Type >
981 template<
typename Type >
993 css::uno::Reference< css::io::XTextOutputStream2 >
mxStrm;
997 ::std::vector< sal_Int32 >
1032 const sal_Int32* pnColWidths ) :
1090 OUStringVector::const_iterator
maIt;
1104 const css::uno::Reference< css::uno::XComponentContext >&
1143 const css::uno::Reference< css::io::XInputStream >& rxStrm,
1144 const OUString& rStrgPath,
1145 const OUString& rStrmName,
1146 const OUString& rSysFileName );
1150 const OUString& rStrgPath,
1151 const OUString& rSysPath );
1155 const OUString& rSysFileName );
1162 std::u16string_view rStrmName,
1163 std::u16string_view rSysOutPath );
1167 const OUString& rStrgPath,
1168 const OUString& rStrmName,
1169 const OUString& rSysFileName );
1172 const OUString& rStrgPath,
1173 const OUString& rSysPath );
1177 const OUString& rStrgPath,
1178 const OUString& rItemName,
1179 std::u16string_view rSysPath,
1180 bool bIsStrg,
bool bIsStrm );
1227 template<
typename Type >
1230 template<
typename Type >
1232 template<
typename Type >
1234 template<
typename Type >
1236 template<
typename Type >
1238 template<
typename Type >
1240 template<
typename Type >
1242 template<
typename Type >
1244 template<
typename Type >
1247 template<
typename Type >
1250 template<
typename Type >
1252 template<
typename Type >
1261template<
typename Type >
1267 mxOut->writeName(
cfg(), nData, rListWrp );
1271template<
typename Type >
1275 mxOut->writeName(
cfg(), nData, rListWrp );
1278template<
typename Type >
1282 mxOut->writeDec( nData );
1286template<
typename Type >
1290 mxOut->writeHex( nData );
1294template<
typename Type >
1298 mxOut->writeShortHex( nData );
1302template<
typename Type >
1306 mxOut->writeBin( nData );
1310template<
typename Type >
1314 mxOut->writeFix( nData );
1318template<
typename Type >
1322 mxOut->writeDec( nData );
1324 mxOut->writeBool( nData != 0 );
1328template<
typename Type >
1336 mxOut->writeValue( nData, eFmtType );
1341template<
typename Type >
1348template<
typename Type >
1352 mxOut->writeDec( nData1 );
1353 mxOut->writeChar( cSep );
1354 mxOut->writeDec( nData2 );
1357template<
typename Type >
1361 mxOut->writeHex( nData1 );
1362 mxOut->writeChar( cSep );
1363 mxOut->writeHex( nData2 );
1387 void skipBlock( sal_Int64 nBytes,
bool bShowSize =
true );
1388 void dumpRawBinary( sal_Int64 nBytes,
bool bShowOffset,
bool bStream =
false );
1390 void dumpBinary(
const String& rName, sal_Int64 nBytes,
bool bShowOffset =
true );
1401 OUString
dumpCharArray(
const String& rName, sal_Int32 nLen, rtl_TextEncoding eTextEnc,
bool bHideTrailingNul =
false );
1409 template<
typename Type >
1411 template<
typename Type >
1413 template<
typename Type >
1415 template<
typename Type >
1417 template<
typename Type >
1419 template<
typename Type >
1421 template<
typename Type >
1424 template<
typename Type1,
typename Type2 >
1426 template<
typename Type1,
typename Type2 >
1428 template<
typename Type1,
typename Type2 >
1430 template<
typename Type1,
typename Type2 >
1432 template<
typename Type1,
typename Type2 >
1434 template<
typename Type1,
typename Type2 >
1436 template<
typename Type1,
typename Type2 >
1439 template<
typename Type >
1441 template<
typename Type >
1449template<
typename Type >
1457template<
typename Type >
1465template<
typename Type >
1473template<
typename Type >
1481template<
typename Type >
1489template<
typename Type >
1497template<
typename Type >
1505template<
typename Type1,
typename Type2 >
1508 return bType1 ? dumpName< Type1 >( rName, rListWrp ) :
static_cast< Type1 >( dumpName< Type2 >( rName, rListWrp ) );
1511template<
typename Type1,
typename Type2 >
1514 return bType1 ? dumpDec< Type1 >( rName, rListWrp ) :
static_cast< Type1 >( dumpDec< Type2 >( rName, rListWrp ) );
1517template<
typename Type1,
typename Type2 >
1520 return bType1 ? dumpHex< Type1 >( rName, rListWrp ) :
static_cast< Type1 >( dumpHex< Type2 >( rName, rListWrp ) );
1523template<
typename Type1,
typename Type2 >
1526 return bType1 ? dumpBin< Type1 >( rName, rListWrp ) :
static_cast< Type1 >( dumpBin< Type2 >( rName, rListWrp ) );
1529template<
typename Type1,
typename Type2 >
1532 return bType1 ? dumpFix< Type1 >( rName, rListWrp ) :
static_cast< Type1 >( dumpFix< Type2 >( rName, rListWrp ) );
1535template<
typename Type1,
typename Type2 >
1538 return bType1 ? dumpBool< Type1 >( rName, rListWrp ) :
static_cast< Type1 >( dumpBool< Type2 >( rName, rListWrp ) );
1541template<
typename Type1,
typename Type2 >
1544 return bType1 ? dumpValue< Type1 >( rItemFmt ) :
static_cast< Type1 >( dumpValue< Type2 >( rItemFmt ) );
1547template<
typename Type >
1550 Type nData1, nData2;
1551 *
mxStrm >> nData1 >> nData2;
1555template<
typename Type >
1558 Type nData1, nData2;
1559 *
mxStrm >> nData1 >> nData2;
1570 const OUString& rSysFileName );
1588 rtl_TextEncoding eTextEnc,
1589 const OUString& rSysFileName );
1593 rtl_TextEncoding eTextEnc );
1613 rtl_TextEncoding eTextEnc,
1614 const OUString& rSysFileName );
1619 rtl_TextEncoding eTextEnc );
1623 void implDumpLine( std::u16string_view rLine, sal_uInt32 nLine );
1633 const OUString& rSysFileName );
1649 const OUString& rSysFileName,
1652 const String& rSimpleRecs );
1668 const String& rSimpleRecs );
1693 const OUString& rSysFileName,
1695 const String& rSimpleRecs );
1725#define OOX_DUMP_FILE( DumperClassName ) \
1727 DumperClassName aDumper( *this ); \
1729 if( !aDumper.isImportEnabled() ) \
1730 return aDumper.isValid(); \
1735#define OOX_DUMP_FILE( DumperClassName ) (void)0
Base class for storage access implementations.
Base class for all dumper classes.
virtual bool implIsValid() const =0
Base(Base const &)=default
static bool isValid(const std::shared_ptr< Base > &rxBase)
Base & operator=(Base const &)=default
void dumpBinaryStream(bool bShowOffset=true)
virtual void implDump() override
BinaryStreamObject(const ObjectBase &rParent, const BinaryInputStreamRef &rxStrm, const OUString &rSysFileName)
::std::map< ExtItemFormatKey, ExtItemFormat > ExtItemFormatMap
virtual void implSetName(sal_Int64 nKey, const OUString &rName) override
Sets the name for the passed key.
ExtItemFormatMap maFmtMap
CombiList(const SharedConfigData &rCfgData)
virtual OUString implGetName(const Config &rCfg, sal_Int64 nKey) const override
Returns the name for the passed key.
virtual void implIncludeList(const NameListBase &rList) override
Inserts all flags from the passed list.
void readConfigBlock(TextInputStream &rStrm)
void processConfigItem(TextInputStream &rStrm, const OUString &rKey, const OUString &rData)
virtual void implProcessConfigItemInt(TextInputStream &rStrm, sal_Int64 nKey, const OUString &rData)
void readConfigBlockContents(TextInputStream &rStrm)
virtual void implProcessConfigItemStr(TextInputStream &rStrm, const OUString &rKey, const OUString &rData)
virtual ~ConfigItemBase()
static LineType readConfigLine(TextInputStream &rStrm, OUString &orKey, OUString &orData)
const OUString & getStringOption(const String &rKey, const OUString &rDefault) const
const StorageRef & getRootStorage() const
Config(Config const &)=default
virtual ~Config() override
const OUString & getSysFileName() const
Type getIntOption(const String &rKey, Type nDefault) const
bool isDumperEnabled() const
bool isImportEnabled() const
NameListRef getNameList(const String &rListName) const
void eraseNameList(const String &rListName)
OUString getName(const NameListWrapper &rListWrp, Type nKey) const
Returns the name for the passed key from the passed name list.
Config & operator=(Config const &)=default
Config(Config &&)=default
void construct(const char *pcEnvVar, const css::uno::Reference< css::uno::XComponentContext > &rxContext, const StorageRef &rxRootStrg, const OUString &rSysFileName)
std::shared_ptr< ListType > createNameList(const String &rListName)
std::shared_ptr< SharedConfigData > mxCfgData
bool getBoolOption(const String &rKey, bool bDefault) const
Config(const char *pcEnvVar, const ::oox::core::FilterBase &rFilter)
const css::uno::Reference< css::uno::XComponentContext > & getContext() const
void construct(const char *pcEnvVar, const ::oox::core::FilterBase &rFilter)
Config(const char *pcEnvVar, const css::uno::Reference< css::uno::XComponentContext > &rxContext, const StorageRef &rxRootStrg, const OUString &rSysFileName)
bool hasName(const NameListWrapper &rListWrp, Type nKey) const
Returns true, if the passed name list contains an entry for the passed key.
const OUString * implGetOption(const OUString &rKey) const
virtual bool implIsValid() const override
virtual void implSetName(sal_Int64 nKey, const OUString &rName) override
Sets the name for the passed key.
virtual void implProcessConfigItemStr(TextInputStream &rStrm, const OUString &rKey, const OUString &rData) override
virtual void implIncludeList(const NameListBase &rList) override
Inserts all names from the passed list.
virtual OUString implGetNameDbl(const Config &rCfg, double fValue) const override
Returns the name for the passed double value.
void setQuoteNames(bool bQuoteNames)
Enables or disables automatic quotation of returned names.
virtual OUString implGetName(const Config &rCfg, sal_Int64 nKey) const override
Returns the name for the passed key, or the default name, if key is not contained.
ConstList(const SharedConfigData &rCfgData)
Base class for a file dumper.
virtual ~DumperBase() override
void construct(const ConfigRef &rxConfig)
bool isImportEnabled() const
virtual void implSetName(sal_Int64 nKey, const OUString &rName) override
Sets the name for the passed key.
virtual void implProcessConfigItemStr(TextInputStream &rStrm, const OUString &rKey, const OUString &rData) override
virtual OUString implGetNameDbl(const Config &rCfg, double fValue) const override
Returns the name for the passed double value.
sal_Int64 getIgnoreFlags() const
Returns the flags to be ignored on output.
FlagsList(const SharedConfigData &rCfgData)
virtual void implIncludeList(const NameListBase &rList) override
Inserts all flags from the passed list.
void setIgnoreFlags(sal_Int64 nIgnore)
Sets flags to be ignored on output.
virtual OUString implGetName(const Config &rCfg, sal_Int64 nKey) const override
Returns the name for the passed key.
IndentGuard & operator=(const IndentGuard &)=delete
IndentGuard(const OutputRef &rxOut)
IndentGuard(const IndentGuard &)=delete
ItemGuard & operator=(const ItemGuard &)=delete
ItemGuard(const OutputRef &rxOut, const String &rName)
ItemGuard(const ItemGuard &)=delete
MultiItemsGuard(const OutputRef &rxOut)
MultiItemsGuard(const MultiItemsGuard &)=delete
MultiItemsGuard & operator=(const MultiItemsGuard &)=delete
virtual void implProcessConfigItemStr(TextInputStream &rStrm, const OUString &rKey, const OUString &rData) override
MultiList(const SharedConfigData &rCfgData)
void setNamesFromVec(sal_Int64 nStartKey, const OUStringVector &rNames)
virtual void implSetName(sal_Int64 nKey, const OUString &rName) override
Sets the name for the passed key.
Base class of all classes providing names for specific values (name lists).
void exclude(std::u16string_view rKeys)
Excludes names from the list, given in a comma separated list of their keys.
virtual OUString implGetName(const Config &rCfg, sal_Int64 nKey) const =0
Derived classes generate and return the name for the passed key.
NameListBase(const SharedConfigData &rCfgData)
bool hasName(Type nKey) const
Returns true, if the map contains an entry for the passed key.
void insertRawName(sal_Int64 nKey, const OUString &rName)
Inserts the passed name into the internal map.
virtual void implProcessConfigItemInt(TextInputStream &rStrm, sal_Int64 nKey, const OUString &rData) override
OUString getName(const Config &rCfg, Type nKey) const
Returns the name for the passed key.
virtual void implProcessConfigItemStr(TextInputStream &rStrm, const OUString &rKey, const OUString &rData) override
void include(std::u16string_view rListKeys)
Includes name lists, given in a comma separated list of names of the lists.
const OUString * findRawName(sal_Int64 nKey) const
Returns the name for the passed key, or 0, if nothing found.
OUString getName(const Config &rCfg, double fValue) const
Returns a display name for the passed double value.
virtual void implSetName(sal_Int64 nKey, const OUString &rName)=0
Derived classes set the name for the passed key.
void includeList(const NameListRef &rxList)
Include all names of the passed list.
const_iterator end() const
Returns a map iterator pointing one past the last contained name.
const_iterator begin() const
Returns a map iterator pointing to the first contained name.
virtual void implIncludeList(const NameListBase &rList)=0
Derived classes insert all names and other settings from the passed list.
const SharedConfigData & mrCfgData
virtual bool implIsValid() const override
::std::map< sal_Int64, OUString > OUStringMap
virtual ~NameListBase() override
void setName(sal_Int64 nKey, const String &rName)
Sets a name for the specified key.
virtual OUString implGetNameDbl(const Config &rCfg, double fValue) const =0
Derived classes generate and return the name for the passed double value.
OUStringMap::const_iterator const_iterator
const NameListRef & getNameList(const Config &rCfg) const
NameListWrapper(NameListRef xList)
NameListWrapper(const char *pcListName)
NameListWrapper(const OUString &rListName)
ObjectBase & operator=(ObjectBase const &)=default
virtual ~ObjectBase() override
virtual bool implIsValid() const override
ObjectBase(ObjectBase const &)=default
void construct(const ConfigRef &rxConfig)
ObjectBase(ObjectBase &&)=default
const css::uno::Reference< css::uno::XComponentContext > & getContext() const
void writeShortHexItem(const String &rName, Type nData, const NameListWrapper &rListWrp=NO_LIST)
void writeEmptyItem(const String &rName)
void writeGuidItem(const String &rName, const OUString &rGuid)
void addNameToItem(Type nData, const NameListWrapper &rListWrp)
void writeNameItem(const String &rName, Type nData, const NameListWrapper &rListWrp)
void writeFixItem(const String &rName, Type nData, const NameListWrapper &rListWrp=NO_LIST)
void writeCharItem(const String &rName, sal_Unicode cData)
void writeDecItem(const String &rName, Type nData, const NameListWrapper &rListWrp=NO_LIST)
virtual bool implIsValid() const override
void writeStringItem(const String &rName, std::u16string_view rData)
OutputObjectBase(OutputObjectBase const &)=default
void writeBinItem(const String &rName, Type nData, const NameListWrapper &rListWrp=NO_LIST)
void writeHexItem(const String &rName, Type nData, const NameListWrapper &rListWrp=NO_LIST)
virtual ~OutputObjectBase() override
OutputObjectBase(OutputObjectBase &&)=default
void writeValueItem(const String &rName, Type nData, FormatType eFmtType, const NameListWrapper &rListWrp=NO_LIST)
void writeDateTimeItem(const String &rName, const css::util::DateTime &rDateTime)
void writeDecPairItem(const String &rName, Type nData1, Type nData2, sal_Unicode cSep=',')
void construct(const ObjectBase &rParent, const OUString &rSysFileName)
void writeDecBoolItem(const String &rName, Type nData, const NameListWrapper &rListWrp=NO_LIST)
void writeInfoItem(const String &rName, const String &rData)
void writeArrayItem(const String &rName, const sal_uInt8 *pnData, std::size_t nSize, sal_Unicode cSep=OOX_DUMP_LISTSEP)
void writeHexPairItem(const String &rName, Type nData1, Type nData2, sal_Unicode cSep=',')
OutputObjectBase & operator=(OutputObjectBase const &)=default
virtual bool implIsValid() const override
css::uno::Reference< css::io::XTextOutputStream2 > mxStrm
void writeHex(Type nData, bool bPrefix=true)
void writeArray(const sal_uInt8 *pnData, std::size_t nSize, sal_Unicode cSep=OOX_DUMP_LISTSEP)
void writeDec(Type nData, sal_Int32 nWidth=0, sal_Unicode cFill=' ')
void writeBin(Type nData, bool bDots=true)
::std::vector< sal_Int32 > maColPos
void writeValue(Type nData, FormatType eFmtType)
void writeAscii(const char *pcStr)
void resetItemIndex(sal_Int64 nIdx=0)
void writeFix(Type nData, sal_Int32 nWidth)
void writeString(std::u16string_view rStr)
void writeItemName(const String &rItemName)
void writeBool(bool bData)
void startTable(sal_Int32 nW1)
void writeDateTime(const css::util::DateTime &rDateTime)
void emptyLine(size_t nCount=1)
Output(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const OUString &rFileName)
void writeShortHex(Type nData, bool bPrefix=true)
void startItem(const String &rItemName)
void writeName(const Config &rCfg, Type nData, const NameListWrapper &rListWrp)
void writeChar(sal_Unicode cChar, sal_Int32 nCount=1)
BinaryInputStreamRef mxBaseStrm
virtual void implDump() override
virtual bool implStartRecord(BinaryInputStream &rBaseStrm, sal_Int64 &ornRecPos, sal_Int64 &ornRecId, sal_Int64 &ornRecSize)=0
void construct(const ObjectBase &rParent, const BinaryInputStreamRef &rxBaseStrm, const OUString &rSysFileName, const BinaryInputStreamRef &rxRecStrm, const String &rRecNames, const String &rSimpleRecs)
virtual void implWriteExtHeader()
NameListWrapper maRecNames
virtual bool implIsValid() const override
void constructRecObjBase(const BinaryInputStreamRef &rxBaseStrm, const String &rRecNames, const String &rSimpleRecs)
NameListWrapper maSimpleRecs
virtual void implDumpRecordBody()
sal_Int64 getRecSize() const
sal_Int64 getRecId() const
std::shared_ptr< StreamDataSequence > mxRecData
virtual bool implStartRecord(BinaryInputStream &rBaseStrm, sal_Int64 &ornRecPos, sal_Int64 &ornRecId, sal_Int64 &ornRecSize) override
void construct(const ObjectBase &rParent, const BinaryInputStreamRef &rxBaseStrm, const OUString &rSysFileName, const String &rRecNames, const String &rSimpleRecs)
virtual bool implReadRecordHeader(BinaryInputStream &rBaseStrm, sal_Int64 &ornRecId, sal_Int64 &ornRecSize)=0
SequenceRecordObjectBase()
void eraseNameList(const OUString &rListName)
const OUString * getOption(const OUString &rKey) const
NameListRef getNameList(const OUString &rListName) const
const OUString & getSysFileName() const
void readNameList(TextInputStream &rStrm, const OUString &rListName)
::std::set< OUString > ConfigFileSet
virtual ~SharedConfigData() override
ConfigFileSet maConfigFiles
virtual void implProcessConfigItemStr(TextInputStream &rStrm, const OUString &rKey, const OUString &rData) override
::std::map< OUString, OUString > ConfigDataMap
SharedConfigData(const OUString &rFileName, const css::uno::Reference< css::uno::XComponentContext > &rxContext, StorageRef xRootStrg, OUString aSysFileName)
void setNameList(const OUString &rListName, const NameListRef &rxList)
const StorageRef & getRootStorage() const
std::shared_ptr< ListType > createNameList(const OUString &rListName)
bool readConfigFile(const OUString &rFileUrl)
::std::map< OUString, NameListRef > NameListMap
css::uno::Reference< css::uno::XComponentContext > mxContext
void createShortList(std::u16string_view rData)
const css::uno::Reference< css::uno::XComponentContext > & getContext() const
virtual bool implIsValid() const override
ConfigDataMap maConfigData
void createUnitConverter(std::u16string_view rData)
virtual ~StorageIterator() override
virtual bool implIsValid() const override
StorageIterator(StorageRef xStrg)
StorageIterator & operator++()
OUStringVector::const_iterator maIt
void extractItem(const StorageRef &rxStrg, const OUString &rStrgPath, const OUString &rItemName, std::u16string_view rSysPath, bool bIsStrg, bool bIsStrm)
void construct(const ObjectBase &rParent, const StorageRef &rxStrg, const OUString &rSysPath)
PreferredItemVector maPreferred
void extractStorage(const StorageRef &rxStrg, const OUString &rStrgPath, const OUString &rSysPath)
static OUString getSysFileName(std::u16string_view rStrmName, std::u16string_view rSysOutPath)
virtual void implDumpBaseStream(const BinaryInputStreamRef &rxStrm, const OUString &rSysFileName)
virtual bool implIsValid() const override
virtual void implDumpStream(const css::uno::Reference< css::io::XInputStream > &rxStrm, const OUString &rStrgPath, const OUString &rStrmName, const OUString &rSysFileName)
::std::vector< PreferredItem > PreferredItemVector
void addPreferredStorage(const String &rStrgPath)
void addPreferredStream(const String &rStrmName)
virtual void implDump() override
virtual void implDumpStorage(const StorageRef &rxStrg, const OUString &rStrgPath, const OUString &rSysPath)
void extractStream(StorageBase &rStrg, const OUString &rStrgPath, const OUString &rStrmName, const OUString &rSysFileName)
Static helper functions for formatted output to strings.
static void appendShortHex(OUStringBuffer &rStr, sal_uInt8 nData, bool bPrefix=true)
static void appendIndex(OUStringBuffer &rStr, sal_Int64 nIdx)
static bool convertStringToInt(sal_Int64 &ornData, std::u16string_view rData)
static bool convertFromDec(sal_Int64 &ornData, std::u16string_view rData)
static bool convertStringToBool(std::u16string_view rData)
static void appendCChar(OUStringBuffer &rStr, sal_Unicode cChar, bool bPrefix=true)
static FormatType convertToFormatType(std::u16string_view rStr)
static void appendEncChar(OUStringBuffer &rStr, sal_Unicode cChar, sal_Int32 nCount, bool bPrefix=true)
static void enclose(OUStringBuffer &rStr, sal_Unicode cOpen, sal_Unicode cClose='\0')
Encloses the passed string with the passed characters.
static bool convertFromHex(sal_Int64 &ornData, std::u16string_view rData)
static void appendValue(OUStringBuffer &rStr, Type nData, FormatType eFmtType)
static OString convertToUtf8(std::u16string_view rStr)
static void appendToken(OUStringBuffer &rStr, std::u16string_view rToken, sal_Unicode cSep=OOX_DUMP_LISTSEP)
static void appendBool(OUStringBuffer &rStr, bool bData)
static void appendString(OUStringBuffer &rStr, std::u16string_view rData, sal_Int32 nWidth, sal_Unicode cFill=' ')
static void appendBin(OUStringBuffer &rStr, sal_uInt8 nData, bool bDots=true)
static OUStringPair convertStringToPair(const OUString &rString, sal_Unicode cSep='=')
static OUString trimTrailingNul(const OUString &rStr)
static std::u16string_view trimSpaces(std::u16string_view rStr)
static void appendChar(OUStringBuffer &rStr, sal_Unicode cChar, sal_Int32 nCount)
static void convertStringToStringList(OUStringVector &orVec, std::u16string_view rData, bool bIgnoreEmpty)
static void appendEncString(OUStringBuffer &rStr, std::u16string_view rData, bool bPrefix=true)
static void appendHex(OUStringBuffer &rStr, sal_uInt8 nData, bool bPrefix=true)
static DataType convertToDataType(std::u16string_view rStr)
static void appendFix(OUStringBuffer &rStr, Type nData, sal_Int32 nWidth=0)
static std::u16string_view getToken(std::u16string_view rData, sal_Int32 &rnPos, sal_Unicode cSep=OOX_DUMP_LISTSEP)
static void convertStringToIntList(Int64Vector &orVec, std::u16string_view rData, bool bIgnoreEmpty)
static void appendDec(OUStringBuffer &rStr, sal_uInt8 nData, sal_Int32 nWidth=0, sal_Unicode cFill=' ')
static bool convertStringToDouble(double &orfData, std::u16string_view rData)
String(sal_Unicode cChar)
String(const char *pcStr)
String(const OUString &rStr)
OUString operator()(const char *pcDefault) const
TableGuard & operator=(const TableGuard &)=delete
TableGuard(const OutputRef &rxOut, size_t nColCount, const sal_Int32 *pnColWidths)
TableGuard(const OutputRef &rxOut, sal_Int32 nW1)
TableGuard(const OutputRef &rxOut, sal_Int32 nW1, sal_Int32 nW2)
TableGuard(const TableGuard &)=delete
TableGuard(const OutputRef &rxOut, sal_Int32 nW1, sal_Int32 nW2, sal_Int32 nW3, sal_Int32 nW4)
TextLineStreamObject(const ObjectBase &rParent, const BinaryInputStreamRef &rxStrm, rtl_TextEncoding eTextEnc, const OUString &rSysFileName)
virtual void implDumpText(TextInputStream &rTextStrm) override
void implDumpLine(std::u16string_view rLine, sal_uInt32 nLine)
std::shared_ptr< TextInputStream > mxTextStrm
virtual void implDump() override
void construct(const ObjectBase &rParent, const BinaryInputStreamRef &rxStrm, rtl_TextEncoding eTextEnc, const OUString &rSysFileName)
virtual bool implIsValid() const override
virtual void implDumpText(TextInputStream &rTextStrm)=0
void constructTextStrmObj(rtl_TextEncoding eTextEnc)
void setUnitName(const String &rUnitName)
virtual void implIncludeList(const NameListBase &rList) override
Empty implementation.
virtual OUString implGetNameDbl(const Config &rCfg, double fValue) const override
Returns the converted value with appended unit name.
UnitConverter(const SharedConfigData &rCfgData)
virtual OUString implGetName(const Config &rCfg, sal_Int64 nKey) const override
Returns the converted value with appended unit name.
void setFactor(double fFactor)
virtual void implSetName(sal_Int64 nKey, const OUString &rName) override
Sets the name for the passed key.
virtual void implDumpText(TextInputStream &rTextStrm) override
XmlStreamObject(const ObjectBase &rParent, const BinaryInputStreamRef &rxStrm, const OUString &rSysFileName)
#define OOX_DUMP_ERR_NOMAP
std::unique_ptr< sal_Int32[]> pData
double getLength(const B2DPolygon &rCandidate)
std::shared_ptr< T > make_shared(Args &&... args)
const sal_Unicode OOX_DUMP_BASECLASS
::std::pair< OUString, OUString > OUStringPair
const sal_Unicode OOX_DUMP_LISTSEP
::std::vector< OUString > OUStringVector
std::shared_ptr< Config > ConfigRef
constexpr OUStringLiteral OOX_DUMP_UNKNOWN
FormatType
Specifiers for the output format of values.
@ FORMATTYPE_HEX
Hexadecimal.
@ FORMATTYPE_SHORTHEX
Hexadecimal, as short as possible (no leading zeros).
@ FORMATTYPE_FIX
Fixed-point.
@ FORMATTYPE_NONE
No numeric format (e.g. show name only).
@ FORMATTYPE_BOOL
Boolean ('true' or 'false').
constexpr OUStringLiteral OOX_DUMP_UNUSED
const sal_Unicode OOX_DUMP_EMPTYVALUE
const sal_Unicode OOX_DUMP_R1C1ROW
const sal_Unicode OOX_DUMP_RANGESEP
const sal_Unicode OOX_DUMP_R1C1OPEN
const String EMPTY_STRING
const sal_Unicode OOX_DUMP_ADDRABS
const sal_Unicode OOX_DUMP_TABSEP
std::shared_ptr< NameListBase > NameListRef
const sal_Unicode OOX_DUMP_PLACEHOLDER
::std::vector< sal_Int64 > Int64Vector
DataType
Specifiers for atomic data types.
@ DATATYPE_UINT64
Unsigned 64-bit integer.
@ DATATYPE_VOID
No data type.
@ DATATYPE_FLOAT
Floating-point, single precision.
@ DATATYPE_INT32
Signed 32-bit integer.
@ DATATYPE_UINT32
Unsigned 32-bit integer.
@ DATATYPE_INT16
Signed 16-bit integer.
@ DATATYPE_INT8
Signed 8-bit integer.
@ DATATYPE_INT64
Signed 64-bit integer.
@ DATATYPE_UINT8
Unsigned 8-bit integer.
@ DATATYPE_DOUBLE
Floating-point, double precision.
@ DATATYPE_UINT16
Unsigned 16-bit integer.
const sal_Unicode OOX_DUMP_ARRAYSEP
const sal_Unicode OOX_DUMP_CMDPROMPT
const NameListWrapper NO_LIST
const sal_Unicode OOX_DUMP_STRQUOTE
const sal_Unicode OOX_DUMP_FUNCSEP
const sal_Unicode OOX_DUMP_R1C1COL
const sal_Unicode OOX_DUMP_R1C1CLOSE
std::shared_ptr< ObjectBase > ObjectRef
std::shared_ptr< Output > OutputRef
const sal_Unicode OOX_DUMP_FMLASTRQUOTE
constexpr OUStringLiteral OOX_DUMP_ERR_NONAME
std::shared_ptr< StorageBase > StorageRef
std::shared_ptr< BinaryInputStream > BinaryInputStreamRef
css::uno::Sequence< sal_Int8 > StreamDataSequence
PreferredItem(OUString aName, bool bStorage)