25#include <com/sun/star/lang/XMultiServiceFactory.hpp>
26#include <com/sun/star/io/TextOutputStream.hpp>
27#include <com/sun/star/ucb/SimpleFileAccess.hpp>
28#include <osl/file.hxx>
29#include <rtl/math.hxx>
30#include <rtl/tencinfo.h>
49using ::oox::core::FilterBase;
54const sal_Int32 OOX_DUMP_MAXSTRLEN = 80;
55const sal_Int32 OOX_DUMP_INDENT = 2;
61const sal_Int32 OOX_DUMP_BYTESPERLINE = 16;
62const sal_Int64 OOX_DUMP_MAXARRAY = 16;
71 if( ::osl::FileBase::getFileURLFromSystemPath( rFileName, aFileUrl ) == ::osl::FileBase::E_None )
78 size_t nSepPos = rFileUrl.find(
'/' );
79 return (nSepPos == std::u16string_view::npos) ? 0 : (nSepPos + 1);
85 size_t nExtPos = rFileUrl.rfind(
'.' );
86 if( nExtPos != std::u16string_view::npos &&
static_cast<sal_Int32
>(nExtPos) >= nNamePos )
87 return rFileUrl.substr( nExtPos + 1 );
88 return std::u16string_view();
94 const Reference< XComponentContext >& rxContext,
const OUString& rFileName )
96 Reference< XInputStream > xInStrm;
97 if( rxContext.is() )
try
99 Reference<XSimpleFileAccess3> xFileAccess(SimpleFileAccess::create(rxContext));
100 xInStrm = xFileAccess->openFileRead( rFileName );
111 const Reference< XComponentContext >& rxContext,
const OUString& rFileName )
113 Reference< XOutputStream > xOutStrm;
114 if( rxContext.is() )
try
116 Reference<XSimpleFileAccess3> xFileAccess(SimpleFileAccess::create(rxContext));
117 xOutStrm = xFileAccess->openFileWrite( rFileName );
126 const Reference< XComponentContext >& rxContext,
const Reference< XOutputStream >& rxOutStrm, rtl_TextEncoding eTextEnc )
128 Reference< XTextOutputStream2 > xTextOutStrm;
129 const char* pcCharset = rtl_getMimeCharsetFromTextEncoding( eTextEnc );
130 if( rxContext.is() && rxOutStrm.is() && pcCharset )
try
132 xTextOutStrm = TextOutputStream::create(rxContext);
133 xTextOutStrm->setOutputStream( rxOutStrm );
134 xTextOutStrm->setEncoding( OUString::createFromAscii( pcCharset ) );
143 const Reference< XComponentContext >& rxContext,
const OUString& rFileName, rtl_TextEncoding eTextEnc )
166 OUStringVector::const_iterator aIt = rFormatVec.begin(), aEnd = rFormatVec.end();
167 OUString aDataType, aFmtType;
168 if( aIt != aEnd ) aDataType = *aIt++;
169 if( aIt != aEnd ) aFmtType = *aIt++;
178 if ( aFmtType ==
"unused" )
180 else if ( aFmtType ==
"unknown" )
191 OUStringVector::const_iterator aIt =
parse( aFormatVec );
200 rStr.append( cChar );
205 appendChar( rStr, cFill, nWidth - rData.size() );
206 rStr.append( rData );
213 appendString( rStr, OUString::number( nData ), nWidth, cFill );
218 appendString( rStr, OUString::number( nData ), nWidth, cFill );
223 appendString( rStr, OUString::number( nData ), nWidth, cFill );
228 appendString( rStr, OUString::number( nData ), nWidth, cFill );
233 appendString( rStr, OUString::number( nData ), nWidth, cFill );
238 appendString( rStr, OUString::number( nData ), nWidth, cFill );
248 aBuffer.append(
static_cast<sal_Int64
>(nData / 10 ) );
255 appendString( rStr, OUString::number( nData ), nWidth, cFill );
260 appendString( rStr, ::rtl::math::doubleToUString( fData, rtl_math_StringFormat_G, 15,
'.',
true ), nWidth, cFill );
267 static const sal_Unicode spcHexDigits[] = {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'A',
'B',
'C',
'D',
'E',
'F' };
270 rStr.append( OUStringChar(spcHexDigits[ (nData >> 4) & 0x0F ] ) + OUStringChar( spcHexDigits[ nData & 0x0F ] ) );
286 appendHex( rStr,
static_cast< sal_uInt16
>( nData ), bPrefix );
291 appendHex( rStr,
static_cast< sal_uInt16
>( nData >> 16 ), bPrefix );
292 appendHex( rStr,
static_cast< sal_uInt16
>( nData ),
false );
297 appendHex( rStr,
static_cast< sal_uInt32
>( nData ), bPrefix );
302 appendHex( rStr,
static_cast< sal_uInt32
>( nData >> 32 ), bPrefix );
303 appendHex( rStr,
static_cast< sal_uInt32
>( nData ),
false );
308 appendHex( rStr,
static_cast< sal_uInt64
>( nData ), bPrefix );
314 sal_uInt64
i = sal_uInt64();
315 for (
size_t j = 0; j <
sizeof(double); ++j)
317 reinterpret_cast<char *
>(&
i)[j] =
reinterpret_cast<char const *
>(&f)[j];
349 appendShortHex( rStr,
static_cast< sal_uInt16
>( nData ), bPrefix );
357 appendShortHex( rStr,
static_cast< sal_uInt16
>( nData ), bPrefix );
362 appendShortHex( rStr,
static_cast< sal_uInt32
>( nData ), bPrefix );
370 appendShortHex( rStr,
static_cast< sal_uInt32
>( nData ), bPrefix );
375 appendShortHex( rStr,
static_cast< sal_uInt64
>( nData ), bPrefix );
387 for(
sal_uInt8 nMask = 0x80; nMask != 0; (nMask >>= 1) &= 0x7F )
389 rStr.append(
static_cast< sal_Unicode >( (nData & nMask) ?
'1' :
'0' ) );
390 if( bDots && (nMask == 0x10) )
391 rStr.append( OOX_DUMP_BINDOT );
404 rStr.append( OOX_DUMP_BINDOT );
410 appendBin( rStr,
static_cast< sal_uInt16
>( nData ), bDots );
415 appendBin( rStr,
static_cast< sal_uInt16
>( nData >> 16 ), bDots );
417 rStr.append( OOX_DUMP_BINDOT );
418 appendBin( rStr,
static_cast< sal_uInt16
>( nData ), bDots );
423 appendBin( rStr,
static_cast< sal_uInt32
>( nData ), bDots );
428 appendBin( rStr,
static_cast< sal_uInt32
>( nData >> 32 ), bDots );
430 rStr.append( OOX_DUMP_BINDOT );
431 appendBin( rStr,
static_cast< sal_uInt32
>( nData ), bDots );
436 appendBin( rStr,
static_cast< sal_uInt64
>( nData ), bDots );
448 rStr.appendAscii( bData ?
"true" :
"false" );
458 rStr.append(
"\\u" );
459 appendHex( rStr,
static_cast< sal_uInt16
>( cChar ),
false );
464 rStr.append(
"\\x" );
474 OUStringBuffer aCode;
476 OUString aCodeStr = aCode.makeStringAndClear();
477 for( sal_Int32 nIdx = 0; nIdx <
nCount; ++nIdx )
478 rStr.append( aCodeStr );
490 size_t nEnd = rData.size();
494 while( (nIdx < nEnd) && (rData[ nIdx ] >= 0x20) ) ++nIdx;
498 if( (nBeg == 0) && (nIdx == nEnd) )
499 rStr.append( rData );
501 rStr.append( rData.substr(nBeg, nIdx - nBeg) );
504 while( (nIdx < nEnd) && (rData[ nIdx ] < 0x20) )
518 if( (rStr.getLength() > 0) && (!rToken.empty()) )
520 rStr.append( rToken );
525 OUStringBuffer aToken;
527 rStr.append(
"[" + aToken +
"]" );
537 rStr.insert( 0, cOpen ).append( cClose ? cClose : cOpen );
544sal_Int32 lclIndexOf( std::u16string_view rStr,
sal_Unicode cChar, sal_Int32 nStartPos )
546 size_t nIndex = rStr.find( cChar, nStartPos );
547 return (nIndex == std::u16string_view::npos) ? rStr.size() :
nIndex;
550OUString lclTrimQuotedStringList( std::u16string_view rStr )
554 size_t nLen = rStr.size();
557 if( rStr[ nPos ] == OOX_DUMP_CFG_QUOTE )
562 OUStringBuffer aToken;
566 size_t nEnd = lclIndexOf( rStr, OOX_DUMP_CFG_QUOTE, nPos );
567 aToken.append( rStr.substr(nPos, nEnd - nPos) );
569 while( (nEnd + 1 < nLen) && (rStr[ nEnd ] == OOX_DUMP_CFG_QUOTE) && (rStr[ nEnd + 1 ] == OOX_DUMP_CFG_QUOTE) )
571 aToken.append( OOX_DUMP_CFG_QUOTE );
577 while( (nPos < nLen) && (rStr[ nPos ] != OOX_DUMP_CFG_QUOTE) );
580 nPos = lclIndexOf( rStr, OOX_DUMP_CFG_LISTSEP, nPos );
589 size_t nEnd = lclIndexOf( rStr, OOX_DUMP_CFG_LISTSEP, nPos );
590 aBuffer.append( rStr.substr(nPos, nEnd - nPos) );
598 return aBuffer.makeStringAndClear();
606 while( (nBeg < rStr.size()) && ((rStr[ nBeg ] ==
' ') || (rStr[ nBeg ] ==
'\t')) )
608 size_t nEnd = rStr.size();
609 while( (nEnd > nBeg) && ((rStr[ nEnd - 1 ] ==
' ') || (rStr[ nEnd - 1 ] ==
'\t')) )
611 return rStr.substr( nBeg, nEnd - nBeg );
616 sal_Int32 nLastPos = rStr.getLength() - 1;
617 if( (nLastPos >= 0) && (rStr[ nLastPos ] == 0) )
618 return rStr.copy( 0, nLastPos );
630 if ( rStr ==
u"int8" )
632 else if ( rStr ==
u"uint8" )
634 else if ( rStr ==
u"int16" )
636 else if ( rStr ==
u"uint16" )
638 else if ( rStr ==
u"int32" )
640 else if ( rStr ==
u"uint32" )
642 else if ( rStr ==
u"int64" )
644 else if ( rStr ==
u"uint64" )
646 else if ( rStr ==
u"float" )
648 else if ( rStr ==
u"double" )
656 if ( rStr ==
u"dec" )
658 else if ( rStr ==
u"hex" )
660 else if ( rStr ==
u"shorthex" )
662 else if ( rStr ==
u"bin" )
664 else if ( rStr ==
u"fix" )
666 else if ( rStr ==
u"bool" )
674 size_t nLen = rData.size();
676 if( (nLen > 0) && (rData[ 0 ] ==
'-') )
685 if( (cChar <
'0') || (cChar >
'9') )
687 ornData = (ornData * 10) + (cChar -
'0');
697 for(
size_t nPos = 0, nLen = rData.size();
nPos < nLen; ++
nPos )
700 if( (
'0' <= cChar) && (cChar <=
'9') )
702 else if( (
'A' <= cChar) && (cChar <=
'F') )
704 else if( (
'a' <= cChar) && (cChar <=
'f') )
708 ornData = (ornData << 4) + cChar;
715 if( (rData.size() > 2) && (rData[ 0 ] ==
'0') && ((rData[ 1 ] ==
'X') || (rData[ 1 ] ==
'x')) )
722 rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok;
726 orfData = rtl_math_uStringToDouble(pBegin,
727 pBegin + rData.size(),
730 nSize =
static_cast<sal_Int32
>(pEnd - pBegin);
731 return (eStatus == rtl_math_ConversionStatus_Ok) && (nSize ==
static_cast<sal_Int32
>(rData.size()));
736 if ( rData ==
u"true" )
738 if ( rData ==
u"false" )
747 if( !rString.isEmpty() )
749 sal_Int32 nEqPos = rString.indexOf( cSep );
752 aPair.first = rString;
766 OUString aUnquotedData = lclTrimQuotedStringList( rData );
768 sal_Int32 nLen = aUnquotedData.getLength();
769 while( (0 <=
nPos) && (
nPos < nLen) )
771 std::u16string_view aToken =
getToken( aUnquotedData,
nPos, OOX_DUMP_LF );
772 if( !bIgnoreEmpty || !aToken.empty() )
773 orVec.push_back( OUString(aToken) );
780 OUString aUnquotedData = lclTrimQuotedStringList( rData );
782 sal_Int32 nLen = aUnquotedData.getLength();
784 while( (0 <=
nPos) && (
nPos < nLen) )
787 if( !bIgnoreEmpty || bOk )
788 orVec.push_back( bOk ? nData : 0 );
818 while( bLoop && !
rStrm.isEof() )
820 OUString aKey,
aData;
837 while( !
rStrm.isEof() && aLine.isEmpty() )
839 aLine =
rStrm.readLine();
840 if( !aLine.isEmpty() && (aLine[ 0 ] == OOX_DUMP_BOM) )
841 aLine = aLine.copy( 1 );
843 if( !aLine.isEmpty() )
847 if( (cChar ==
'#') || (cChar ==
';') )
854 orData = aPair.second;
855 return ( !orKey.isEmpty() && (!orData.isEmpty() || orKey !=
"end" )) ?
882 for (
auto const& elem : *rxList)
883 maMap[ elem.first ] = elem.second;
896 if ( rKey ==
"include" )
898 else if ( rKey ==
"exclude" )
912 maMap[ nKey ] = rName;
918 return (aIt ==
end()) ? nullptr : &aIt->second;
925 for (
auto const& elem : aVec)
933 for (
auto const& elem : aVec)
941 for (
auto const& elemName : *rxNameList)
942 maMap[ elemName.first ].parse( elemName.second );
949 mbQuoteNames( false )
956 if ( rKey ==
"default" )
958 else if ( rKey ==
"quote-names" )
998 mbIgnoreEmpty( true )
1004 sal_Int64 nKey = nStartKey;
1005 for (
auto const&
name : rNames)
1016 if ( rKey ==
"ignore-empty" )
1038 if ( rKey ==
"ignore" )
1052 if( (nKey != 0) && ((nKey & (nKey - 1)) == 0) )
1059 OUStringBuffer
aName;
1063 sal_Int64 nMask = aIt->first;
1067 const OUString& rFlagName = aIt->second;
1068 bool bOnOff = rFlagName.startsWith(
":");
1069 bool bFlag =
getFlag( nKey, nMask );
1073 aName.appendAscii( bFlag ?
":on" :
":off" );
1077 bool bNegated = rFlagName.startsWith(
"!");
1078 sal_Int32 nBothSep = bNegated ? rFlagName.indexOf(
'!', 1 ) : -1;
1083 else if( nBothSep > 0 )
1097 setFlag( nKey, nFound,
false );
1100 OUStringBuffer aUnknown( OUString::Concat(
OOX_DUMP_UNKNOWN) + OUStringChar(OOX_DUMP_ITEMSEP) );
1105 return aName.makeStringAndClear();
1131 if( (nKey & (nKey - 1)) != 0 )
1133 ::std::set< ExtItemFormatKey > aItemKeys;
1136 for (
auto const& elemRemain : aRemain)
1139 if ( aPair.first ==
"noshift" )
1143 else if ( aPair.first ==
"filter" )
1146 ExtItemFormatKey aKey( nKey );
1150 if( aKey.maFilter.first == 0 )
1151 aKey.maFilter.second = 0;
1152 aItemKeys.insert( aKey );
1156 if( aItemKeys.empty() )
1157 aItemKeys.insert( ExtItemFormatKey( nKey ) );
1158 for (
auto const& itemKey : aItemKeys)
1169 sal_Int64 nFound = 0;
1170 OUStringBuffer
aName;
1175 sal_Int64 nMask = rMapKey.
mnKey;
1176 if( (nMask != 0) && ((nKey & rMapKey.
maFilter.first) == rMapKey.
maFilter.second) )
1180 sal_uInt64 nUFlags =
static_cast< sal_uInt64
>( nKey );
1181 sal_uInt64 nUMask =
static_cast< sal_uInt64
>( nMask );
1183 while( (nUMask & 1) == 0 ) { nUFlags >>= 1; nUMask >>= 1; }
1185 sal_uInt64 nUValue = nUFlags & nUMask;
1186 sal_Int64 nSValue =
static_cast< sal_Int64
>( nUValue );
1187 if( getFlag< sal_uInt64 >( nUValue, (nUMask + 1) >> 1 ) )
1188 setFlag( nSValue,
static_cast< sal_Int64
>( ~nUMask ) );
1191 OUStringBuffer aValue;
1209 OUString aValueName = rCfg.
getName( rItemFmt.
maListName,
static_cast< sal_Int64
>( nUValue ) );
1217 setFlag( nKey, nFound,
false );
1219 return aName.makeStringAndClear();
1247 OUStringBuffer aValue;
1250 return aValue.makeStringAndClear();
1265 const Reference< XComponentContext >& rxContext,
StorageRef xRootStrg,
1266 OUString aSysFileName ) :
1268 mxRootStrg(
std::move( xRootStrg )),
1269 maSysFileName(
std::move( aSysFileName )),
1273 if( !aFileUrl.isEmpty() )
1287 ConfigDataMap::const_iterator aIt =
maConfigData.find( rKey );
1288 return (aIt ==
maConfigData.end()) ? nullptr : &aIt->second;
1293 if( !rListName.isEmpty() )
1305 NameListMap::const_iterator aIt =
maNameLists.find( rListName );
1307 xList = aIt->second;
1319 if ( rKey ==
"include-config-file" )
1321 else if ( rKey ==
"constlist" )
1322 readNameList< ConstList >(
rStrm, rData );
1323 else if ( rKey ==
"multilist" )
1324 readNameList< MultiList >(
rStrm, rData );
1325 else if ( rKey ==
"flagslist" )
1326 readNameList< FlagsList >(
rStrm, rData );
1327 else if ( rKey ==
"combilist" )
1328 readNameList< CombiList >(
rStrm, rData );
1329 else if ( rKey ==
"shortlist" )
1331 else if ( rKey ==
"unitconverter" )
1344 if( !aTxtStrm.
isEof() )
1358 if( aDataVec.size() < 3 )
1361 sal_Int64 nStartKey;
1364 std::shared_ptr< MultiList > xList = createNameList< MultiList >( aDataVec[ 0 ] );
1367 aDataVec.erase( aDataVec.begin(), aDataVec.begin() + 2 );
1368 xList->setNamesFromVec( nStartKey, aDataVec );
1377 if( aDataVec.size() < 2 )
1380 OUString aFactor = aDataVec[ 1 ];
1381 bool bRecip = aFactor.startsWith(
"/");
1383 aFactor = aFactor.copy( 1 );
1387 std::shared_ptr< UnitConverter > xList = createNameList< UnitConverter >( aDataVec[ 0 ] );
1390 xList->setFactor( bRecip ? (1.0 / fFactor) : fFactor );
1391 if( aDataVec.size() >= 3 )
1392 xList->setUnitName( aDataVec[ 2 ] );
1402Config::Config(
const char* pcEnvVar,
const Reference< XComponentContext >& rxContext,
const StorageRef& rxRootStrg,
const OUString& rSysFileName )
1404 construct( pcEnvVar, rxContext, rxRootStrg, rSysFileName );
1413 if( !rFilter.getFileUrl().isEmpty() )
1414 construct( pcEnvVar, rFilter.getComponentContext(), rFilter.getStorage(), rFilter.getFileUrl() );
1417void Config::construct(
const char* pcEnvVar,
const Reference< XComponentContext >& rxContext,
const StorageRef& rxRootStrg,
const OUString& rSysFileName )
1419 if( pcEnvVar && rxRootStrg && !rSysFileName.isEmpty() )
1420 if(
const char* pcFileName = ::getenv( pcEnvVar ) )
1421 mxCfgData = std::make_shared<SharedConfigData>( OUString::createFromAscii( pcFileName ), rxContext, rxRootStrg, rSysFileName );
1453 return mxCfgData->getNameList( rListName );
1466Output::Output(
const Reference< XComponentContext >& rxContext,
const OUString& rFileName ) :
1467 mxStrm(
InputOutputHelper::openTextOutputStream( rxContext, rFileName, RTL_TEXTENCODING_UTF8 ) ),
1475 mxStrm->writeString( OUString( OOX_DUMP_BOM ) );
1480 if(
maLine.getLength() > 0 )
1492 for(
size_t nIdx = 0; nIdx <
nCount; ++nIdx )
1493 mxStrm->writeString( OUString(
'\n') );
1505 if(
maIndent.getLength() >= OOX_DUMP_INDENT )
1516 sal_Int32 pnColWidths[ 2 ];
1517 pnColWidths[ 0 ] = nW1;
1518 pnColWidths[ 1 ] = nW2;
1524 sal_Int32 pnColWidths[ 4 ];
1525 pnColWidths[ 0 ] = nW1;
1526 pnColWidths[ 1 ] = nW2;
1527 pnColWidths[ 2 ] = nW3;
1528 pnColWidths[ 3 ] = nW4;
1536 sal_Int32 nColPos = 0;
1537 for(
size_t nCol = 0; nCol < nColCount; ++nCol )
1539 nColPos = nColPos + pnColWidths[ nCol ];
1555 if(
maLine.getLength() >= nColPos )
1556 maLine.setLength( ::std::max< sal_Int32 >( nColPos - 1, 0 ) );
1581 if( rItemName.
has() )
1595 if( (
maLine.getLength() == 0) || (
maLine[
maLine.getLength() - 1 ] != OOX_DUMP_ITEMSEP) )
1640 maLine.appendAscii( pcStr );
1650 const sal_uInt8* pnEnd = pnData ? (pnData + nSize) :
nullptr;
1651 for(
const sal_uInt8* pnByte = pnData; pnByte < pnEnd; ++pnByte )
1653 if( pnByte > pnData )
1666 writeDec( rDateTime.Year, 4,
'0' );
1668 writeDec( rDateTime.Month, 2,
'0' );
1672 writeDec( rDateTime.Hours, 2,
'0' );
1674 writeDec( rDateTime.Minutes, 2,
'0' );
1676 writeDec( rDateTime.Seconds, 2,
'0' );
1686 if( rItemName.
has() && (rItemName[ 0 ] ==
'#') )
1696 mxStrg(
std::move( xStrg ))
1732 return xStrg && xStrg->isStorage();
1793 bool bIsStrg =
mxStrg->isStorage();
1794 bool bIsRoot =
mxStrg->isRootStorage();
1795 Reference< XInputStream > xBaseStrm;
1797 xBaseStrm =
mxStrg->openInputStream( OUString() );
1803 Reference<XSimpleFileAccess3> xFileAccess(SimpleFileAccess::create(
getContext()));
1804 xFileAccess->kill( aSysOutPath );
1814 else if( xBaseStrm.is() )
1817 xInStrm->seekToStart();
1837 if( rStrmName.
has() )
1843 if( rStrgPath.
has() )
1848 std::u16string_view rStrmName, std::u16string_view rSysOutPath )
1855 OUString aFileName =
aBuffer.makeStringAndClear();
1856 static const sal_Unicode spcReserved[] = {
'/',
'\\',
':',
'*',
'?',
'<',
'>',
'|' };
1858 aFileName = aFileName.replace(cChar,
'_');
1861 return OUString::Concat(rSysOutPath) +
"/" + aFileName;
1867 if( !aInStrm.
isEof() )
1870 if( !aOutStrm.
isEof() )
1874 if( xDumpStrm.is() )
1881 ::osl::FileBase::RC eRes = ::osl::Directory::create( rSysPath );
1882 if( (eRes != ::osl::FileBase::E_None) && (eRes != ::osl::FileBase::E_EXIST) )
1886 if( rStrgPath.isEmpty() )
1889 extractItem( rxStrg, rStrgPath, elemPreferred.maName, rSysPath, elemPreferred.mbStorage, !elemPreferred.mbStorage );
1896 OUString aItemName = aIt.getName();
1897 bool bFound =
false;
1898 if( rStrgPath.isEmpty() )
1902 bFound = elemPreferred.maName == aItemName;
1908 extractItem( rxStrg, rStrgPath, aItemName, rSysPath, aIt.isStorage(), aIt.isStream() );
1917 OUStringBuffer aStrgPath( rStrgPath );
1919 implDumpStorage( rxStrg->openSubStorage( rItemName,
false ), aStrgPath.makeStringAndClear(), aSysFileName );
1923 extractStream( *rxStrg, rStrgPath, rItemName, aSysFileName );
1959 mxOut->writeString( rData );
1966 mxOut->writeChar( cData );
1973 mxOut->writeAscii(
"(len=" );
1974 mxOut->writeDec( sal_Int32(rData.size()) );
1975 mxOut->writeAscii(
")," );
1976 OUStringBuffer aValue( rData.substr( 0, ::std::min( sal_Int32(rData.size()), OOX_DUMP_MAXSTRLEN ) ) );
1978 mxOut->writeString( aValue.makeStringAndClear() );
1979 if( rData.size() > OOX_DUMP_MAXSTRLEN )
1980 mxOut->writeAscii(
",cut" );
1986 mxOut->writeArray( pnData, nSize, cSep );
1992 mxOut->writeDateTime( rDateTime );
1998 mxOut->writeString( rGuid );
2000 mxOut->writeString(
cfg().getStringOption( rGuid, OUString() ) );
2031 sal_Int64 nEndPos = ::std::min< sal_Int64 >(
mxStrm->tell() + nBytes,
mxStrm->size() );
2032 if(
mxStrm->tell() < nEndPos )
2035 writeDecItem(
"skipped-data-size",
static_cast< sal_uInt64
>( nEndPos -
mxStrm->tell() ) );
2043 bShowOffset ? 12 : 0,
2044 3 * OOX_DUMP_BYTESPERLINE / 2 + 1,
2045 3 * OOX_DUMP_BYTESPERLINE / 2 + 1,
2046 OOX_DUMP_BYTESPERLINE / 2 + 1 );
2049 bStream ?
"max-binary-stream-size" :
"max-binary-data-size",
SAL_MAX_INT64 );
2051 bool bSeekable =
mxStrm->size() >= 0;
2052 sal_Int64 nEndPos = bSeekable ? ::std::min< sal_Int64 >(
mxStrm->tell() + nBytes,
mxStrm->size() ) : 0;
2053 sal_Int64 nDumpEnd = bSeekable ? ::std::min< sal_Int64 >(
mxStrm->tell() + nMaxShowSize, nEndPos ) : nMaxShowSize;
2054 sal_Int64
nPos = bSeekable ?
mxStrm->tell() : 0;
2057 while( bLoop && (
nPos < nDumpEnd) )
2059 mxOut->writeHex(
static_cast< sal_uInt32
>(
nPos ) );
2062 sal_uInt8 pnLineData[ OOX_DUMP_BYTESPERLINE ];
2063 sal_Int32 nLineSize = bSeekable ? ::std::min(
static_cast< sal_Int32
>( nDumpEnd -
mxStrm->tell() ), OOX_DUMP_BYTESPERLINE ) : OOX_DUMP_BYTESPERLINE;
2064 sal_Int32 nReadSize =
mxStrm->readMemory( pnLineData, nLineSize );
2065 bLoop = nReadSize == nLineSize;
2072 for( pnByte = pnLineData, pnEnd = pnLineData + nReadSize; pnByte != pnEnd; ++pnByte )
2074 if( (pnByte - pnLineData) == (OOX_DUMP_BYTESPERLINE / 2) )
mxOut->tab();
2075 mxOut->writeHex( *pnByte,
false );
2076 mxOut->writeChar(
' ' );
2080 for( pnByte = pnLineData, pnEnd = pnLineData + nReadSize; pnByte != pnEnd; ++pnByte )
2082 if( (pnByte - pnLineData) == (OOX_DUMP_BYTESPERLINE / 2) )
mxOut->tab();
2083 mxOut->writeChar(
static_cast< sal_Unicode >( (*pnByte < 0x20) ?
'.' : *pnByte ) );
2109 if(
cfg().getBoolOption(
"show-trailing-unknown",
true ) )
2110 dumpBinary(
"remaining-data", nBytes,
false );
2132 sal_Int32 nDumpSize = getLimitedValue< sal_Int32, sal_Int64 >(
mxStrm->size() -
mxStrm->tell(), 0, nBytes );
2133 if( nDumpSize > OOX_DUMP_MAXARRAY )
2137 else if( nDumpSize > 1 )
2140 mxStrm->readMemory( pnData, nDumpSize );
2143 else if( nDumpSize == 1 )
2144 dumpHex< sal_uInt8 >( rName );
2149 sal_uInt16 nChar =
mxStrm->readuInt16();
2157 sal_Int32 nDumpSize = getLimitedValue< sal_Int32, sal_Int64 >(
mxStrm->size() -
mxStrm->tell(), 0, nLen );
2161 ::std::vector< char >
aBuffer(
static_cast< std::size_t
>( nLen ) + 1 );
2162 sal_Int32 nCharsRead =
mxStrm->readMemory(
aBuffer.data(), nLen);
2164 aString = OStringToOUString(std::string_view(
aBuffer.data()), eTextEnc);
2166 if( bHideTrailingNul )
2179 OUString aString =
aBuffer.makeStringAndClear();
2180 if( bHideTrailingNul )
2188 util::DateTime aDateTime;
2191 sal_Int64 nFileTime = dumpDec< sal_Int64 >(
EMPTY_STRING );
2197 sal_Int64 nYears = (nDays - (nDays / (4 * 365)) + (nDays / (100 * 365)) - (nDays / (400 * 365))) / 365;
2199 sal_Int64 nDaysInYear = nDays - (nYears * 365 + nYears / 4 - nYears / 100 + nYears / 400);
2201 aDateTime.Year =
static_cast< sal_uInt16
>( 1601 + nYears );
2203 bool bLeap = ((aDateTime.Year % 4 == 0) && (aDateTime.Year % 100 != 0)) || (aDateTime.Year % 400 == 0);
2205 static const sal_Int64 spnDaysInMonth[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
2206 static const sal_Int64 spnDaysInMonthL[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
2207 const sal_Int64* pnDaysInMonth = bLeap ? spnDaysInMonthL : spnDaysInMonth;
2209 aDateTime.Month = 1;
2210 while( nDaysInYear >= *pnDaysInMonth )
2212 nDaysInYear -= *pnDaysInMonth++;
2216 aDateTime.Day =
static_cast< sal_uInt16
>( nDaysInYear + 1 );
2229 aDateTime.Hours =
static_cast< sal_uInt16
>( nTimeInDay );
2242 nData32 =
mxStrm->readuInt32();
2245 nData16 =
mxStrm->readuInt16();
2248 nData16 =
mxStrm->readuInt16();
2251 nData8 =
mxStrm->readuChar();
2253 nData8 =
mxStrm->readuChar( );
2258 nData8 =
mxStrm->readuChar( );
2262 OUString aGuid =
aBuffer.makeStringAndClear();
2272 case DATATYPE_INT8: dumpValue< sal_Int8 >( rItemFmt );
break;
2347 sal_uInt32 nLine = 0;
2348 while( !rTextStrm.
isEof() )
2350 OUString aLine = rTextStrm.
readLine();
2351 if( !rTextStrm.
isEof() || !aLine.isEmpty() )
2359 mxOut->writeDec( nLine, 6 );
2361 mxOut->writeString( rLine );
2375 OUStringBuffer aOldStartElem;
2379 while( !rTextStrm.
isEof() )
2382 OUString aElem = rTextStrm.
readToChar(
'>',
true ).trim();
2383 OUString aText = rTextStrm.
readToChar(
'<',
false );
2387 while(
nPos < aElem.getLength() )
2389 while( (
nPos < aElem.getLength()) && (aElem[
nPos ] >= 32) ) ++
nPos;
2390 if(
nPos < aElem.getLength() )
2391 aElem = aElem.subView( 0,
nPos ) + OUStringChar(
' ') +
o3tl::trim(aElem.subView(
nPos ));
2395 sal_Int32 nElemLen = aElem.getLength();
2396 if( (nElemLen >= 2) && (aElem[ 0 ] ==
'<') && (aElem[ nElemLen - 1 ] ==
'>') )
2399 bool bSimpleElem = (aElem[ 1 ] ==
'!') || (aElem[ 1 ] ==
'?') || (aElem[ nElemLen - 2 ] ==
'/') ||
2400 (bIsVml && (nElemLen == 4) && (aElem[ 1 ] ==
'b') && (aElem[ 2 ] ==
'r'));
2401 bool bStartElem = !bSimpleElem && (aElem[ 1 ] !=
'/');
2402 bool bEndElem = !bSimpleElem && !bStartElem;
2408 if( (bSimpleElem || bStartElem) && (aOldStartElem.getLength() > 0) )
2419 aOldStartElem.append( aElem + aText );
2430 if( aOldStartElem.getLength() == 0 )
2433 mxOut->writeString( aOldStartElem.makeStringAndClear() );
2439 mxOut->writeString( aElem );
2443 mxOut->writeString( aText );
2476 sal_Int64 nRecPos =
mxStrm->tell();
2481 ::std::map< sal_Int64, ItemFormat >::const_iterator aIt = aSimpleRecs.
find(
mnRecId );
2482 if( aIt != aSimpleRecs.
end() )
2541 ornRecPos = rBaseStrm.
tell();
2543 bValid = ornRecPos < rBaseStrm.
size();
2548 bValid =
implReadRecordHeader( rBaseStrm, ornRecId, ornRecSize ) && !rBaseStrm.
isEof() && (0 <= ornRecSize) && (ornRecSize <= 0x00100000);
2553 sal_Int32 nRecSize =
static_cast< sal_Int32
>( ornRecSize );
2555 bValid = (nRecSize == 0) || (rBaseStrm.
readData( *
mxRecData, nRecSize ) == nRecSize);
2572 if(
isValid( rxConfig ) && rxConfig->isDumperEnabled() )
bool isSeekable() const
Returns true, if the implementation supports the seek() operation.
virtual sal_Int64 size() const =0
Implementations return the size of the stream, if possible.
bool isEof() const
Returns true, if the stream position is invalid (EOF).
virtual sal_Int64 tell() const =0
Implementations return the current stream position, if possible.
Wraps a UNO output stream and provides convenient access functions.
Base class for storage access implementations.
css::uno::Reference< css::io::XInputStream > openInputStream(const OUString &rStreamName)
Opens and returns the specified input stream from the storage.
bool isEof() const
Returns true, if no more text is available in the stream.
OUString readLine()
Reads a text line from the stream.
OUString readToChar(sal_Unicode cChar, bool bIncludeChar)
Reads a text portion from the stream until the specified character is found.
void dumpBinaryStream(bool bShowOffset=true)
virtual void implDump() override
BinaryStreamObject(const ObjectBase &rParent, const BinaryInputStreamRef &rxStrm, const OUString &rSysFileName)
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
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.
std::shared_ptr< SharedConfigData > mxCfgData
bool getBoolOption(const String &rKey, bool bDefault) const
void construct(const char *pcEnvVar, const ::oox::core::FilterBase &rFilter)
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)
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.
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.
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.
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
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.
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
virtual ~NameListBase() override
void setName(sal_Int64 nKey, const String &rName)
Sets a name for the specified key.
OUStringMap::const_iterator const_iterator
const NameListRef & getNameList(const Config &rCfg) const
virtual ~ObjectBase() override
virtual bool implIsValid() const override
void construct(const ConfigRef &rxConfig)
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 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)
virtual ~OutputObjectBase() override
void writeDateTimeItem(const String &rName, const css::util::DateTime &rDateTime)
void construct(const ObjectBase &rParent, const OUString &rSysFileName)
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)
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=' ')
::std::vector< sal_Int32 > maColPos
void writeAscii(const char *pcStr)
void resetItemIndex(sal_Int64 nIdx=0)
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 startItem(const String &rItemName)
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()
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
void eraseNameList(const OUString &rListName)
const OUString * getOption(const OUString &rKey) const
NameListRef getNameList(const OUString &rListName) const
virtual ~SharedConfigData() override
ConfigFileSet maConfigFiles
virtual void implProcessConfigItemStr(TextInputStream &rStrm, const OUString &rKey, const OUString &rData) override
SharedConfigData(const OUString &rFileName, const css::uno::Reference< css::uno::XComponentContext > &rxContext, StorageRef xRootStrg, OUString aSysFileName)
void setNameList(const OUString &rListName, const NameListRef &rxList)
bool readConfigFile(const OUString &rFileUrl)
css::uno::Reference< css::uno::XComponentContext > mxContext
void createShortList(std::u16string_view rData)
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)
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 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 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)
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)
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.
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_STREAM
std::unique_ptr< sal_Int32[]> pData
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
static sal_uInt64 lcl_ConvertDouble(double const f)
::std::pair< OUString, OUString > OUStringPair
::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 String EMPTY_STRING
std::shared_ptr< NameListBase > NameListRef
::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_STRQUOTE
constexpr OUStringLiteral OOX_DUMP_ERR_NONAME
void setFlag(Type &ornBitField, Type nMask, bool bSet=true)
Sets or clears (according to bSet) all set bits of nMask in ornBitField.
std::shared_ptr< StorageBase > StorageRef
bool getFlag(Type nBitField, Type nMask)
Returns true, if at least one of the bits set in nMask is set in nBitField.
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
std::unique_ptr< char[]> aBuffer