23 #include <string_view>
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>
48 using ::oox::core::FilterBase;
53 const sal_Int32 OOX_DUMP_MAXSTRLEN = 80;
54 const sal_Int32 OOX_DUMP_INDENT = 2;
60 const sal_Int32 OOX_DUMP_BYTESPERLINE = 16;
61 const sal_Int64 OOX_DUMP_MAXARRAY = 16;
70 if( ::osl::FileBase::getFileURLFromSystemPath( rFileName, aFileUrl ) == ::osl::FileBase::E_None )
77 size_t nSepPos = rFileUrl.find(
'/' );
78 return (nSepPos == std::u16string_view::npos) ? 0 : (nSepPos + 1);
84 size_t nExtPos = rFileUrl.rfind(
'.' );
85 if( nExtPos != std::u16string_view::npos && static_cast<sal_Int32>(nExtPos) >= nNamePos )
86 return rFileUrl.substr( nExtPos + 1 );
87 return std::u16string_view();
96 if( rxContext.is() )
try
98 Reference<XSimpleFileAccess3> xFileAccess(SimpleFileAccess::create(rxContext));
99 xInStrm = xFileAccess->openFileRead( rFileName );
112 Reference< XOutputStream > xOutStrm;
113 if( rxContext.is() )
try
115 Reference<XSimpleFileAccess3> xFileAccess(SimpleFileAccess::create(rxContext));
116 xOutStrm = xFileAccess->openFileWrite( rFileName );
127 Reference< XTextOutputStream2 > xTextOutStrm;
128 const char* pcCharset = rtl_getMimeCharsetFromTextEncoding( eTextEnc );
129 if( rxContext.is() && rxOutStrm.is() && pcCharset )
try
131 xTextOutStrm = TextOutputStream::create(rxContext);
132 xTextOutStrm->setOutputStream( rxOutStrm );
133 xTextOutStrm->setEncoding( OUString::createFromAscii( pcCharset ) );
165 OUStringVector::const_iterator aIt = rFormatVec.begin(), aEnd = rFormatVec.end();
166 OUString aDataType, aFmtType;
167 if( aIt != aEnd ) aDataType = *aIt++;
168 if( aIt != aEnd ) aFmtType = *aIt++;
177 if ( aFmtType ==
"unused" )
179 else if ( aFmtType ==
"unknown" )
190 OUStringVector::const_iterator aIt =
parse( aFormatVec );
191 return OUStringVector( aIt, const_cast< const OUStringVector& >( aFormatVec ).
end() );
199 rStr.append( cChar );
204 appendChar( rStr, cFill, nWidth - rData.getLength() );
205 rStr.append( rData );
212 appendString( rStr, OUString::number( nData ), nWidth, cFill );
217 appendString( rStr, OUString::number( nData ), nWidth, cFill );
222 appendString( rStr, OUString::number( nData ), nWidth, cFill );
227 appendString( rStr, OUString::number( nData ), nWidth, cFill );
232 appendString( rStr, OUString::number( nData ), nWidth, cFill );
237 appendString( rStr, OUString::number( nData ), nWidth, cFill );
247 aBuffer.append( static_cast<sal_Int64>(nData / 10 ) );
248 aBuffer.append( static_cast< sal_Unicode >(
'0' + (nData % 10) ) );
249 appendString( rStr, aBuffer.makeStringAndClear(), nWidth, cFill );
254 appendString( rStr, OUString::number( nData ), nWidth, cFill );
259 appendString( rStr, ::rtl::math::doubleToUString( fData, rtl_math_StringFormat_G, 15,
'.',
true ), nWidth, cFill );
266 static const sal_Unicode spcHexDigits[] = {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'A',
'B',
'C',
'D',
'E',
'F' };
269 rStr.append( spcHexDigits[ (nData >> 4) & 0x0F ] ).append( spcHexDigits[ nData & 0x0F ] );
274 appendHex( rStr, static_cast< sal_uInt8 >( nData ), bPrefix );
279 appendHex( rStr, static_cast< sal_uInt8 >( nData >> 8 ), bPrefix );
280 appendHex( rStr, static_cast< sal_uInt8 >( nData ),
false );
285 appendHex( rStr, static_cast< sal_uInt16 >( nData ), bPrefix );
290 appendHex( rStr, static_cast< sal_uInt16 >( nData >> 16 ), bPrefix );
291 appendHex( rStr, static_cast< sal_uInt16 >( nData ),
false );
296 appendHex( rStr, static_cast< sal_uInt32 >( nData ), bPrefix );
301 appendHex( rStr, static_cast< sal_uInt32 >( nData >> 32 ), bPrefix );
302 appendHex( rStr, static_cast< sal_uInt32 >( nData ),
false );
307 appendHex( rStr, static_cast< sal_uInt64 >( nData ), bPrefix );
313 sal_uInt64
i = sal_uInt64();
314 for (
size_t j = 0; j <
sizeof(double); ++j)
316 reinterpret_cast<char *
>(&
i)[j] = reinterpret_cast<char const *>(&f)[j];
343 appendHex( rStr, static_cast< sal_uInt8 >( nData ), bPrefix );
348 appendShortHex( rStr, static_cast< sal_uInt16 >( nData ), bPrefix );
356 appendShortHex( rStr, static_cast< sal_uInt16 >( nData ), bPrefix );
361 appendShortHex( rStr, static_cast< sal_uInt32 >( nData ), bPrefix );
369 appendShortHex( rStr, static_cast< sal_uInt32 >( nData ), bPrefix );
374 appendShortHex( rStr, static_cast< sal_uInt64 >( nData ), bPrefix );
386 for(
sal_uInt8 nMask = 0x80; nMask != 0; (nMask >>= 1) &= 0x7F )
388 rStr.append( static_cast< sal_Unicode >( (nData & nMask) ?
'1' :
'0' ) );
389 if( bDots && (nMask == 0x10) )
390 rStr.append( OOX_DUMP_BINDOT );
396 appendBin( rStr, static_cast< sal_uInt8 >( nData ), bDots );
401 appendBin( rStr, static_cast< sal_uInt8 >( nData >> 8 ), bDots );
403 rStr.append( OOX_DUMP_BINDOT );
404 appendBin( rStr, static_cast< sal_uInt8 >( nData ), bDots );
409 appendBin( rStr, static_cast< sal_uInt16 >( nData ), bDots );
414 appendBin( rStr, static_cast< sal_uInt16 >( nData >> 16 ), bDots );
416 rStr.append( OOX_DUMP_BINDOT );
417 appendBin( rStr, static_cast< sal_uInt16 >( nData ), bDots );
422 appendBin( rStr, static_cast< sal_uInt32 >( nData ), bDots );
427 appendBin( rStr, static_cast< sal_uInt32 >( nData >> 32 ), bDots );
429 rStr.append( OOX_DUMP_BINDOT );
430 appendBin( rStr, static_cast< sal_uInt32 >( nData ), bDots );
435 appendBin( rStr, static_cast< sal_uInt64 >( nData ), bDots );
447 rStr.appendAscii( bData ?
"true" :
"false" );
457 rStr.append(
"\\u" );
458 appendHex( rStr, static_cast< sal_uInt16 >( cChar ),
false );
463 rStr.append(
"\\x" );
464 appendHex( rStr, static_cast< sal_uInt8 >( cChar ),
false );
473 OUStringBuffer aCode;
475 OUString aCodeStr = aCode.makeStringAndClear();
476 for( sal_Int32 nIdx = 0; nIdx <
nCount; ++nIdx )
477 rStr.append( aCodeStr );
489 sal_Int32 nEnd = rData.getLength();
493 while( (nIdx < nEnd) && (rData[ nIdx ] >= 0x20) ) ++nIdx;
497 if( (nBeg == 0) && (nIdx == nEnd) )
498 rStr.append( rData );
500 rStr.append( rData.subView(nBeg, nIdx - nBeg) );
503 while( (nIdx < nEnd) && (rData[ nIdx ] < 0x20) )
517 if( (rStr.getLength() > 0) && (!rToken.empty()) )
519 rStr.append( rToken );
524 OUStringBuffer aToken;
526 rStr.append(
'[' ).append( aToken.makeStringAndClear() ).append(
']' );
536 rStr.insert( 0, cOpen ).append( cClose ? cClose : cOpen );
543 sal_Int32 lclIndexOf(
const OUString& rStr,
sal_Unicode cChar, sal_Int32 nStartPos )
545 sal_Int32
nIndex = rStr.indexOf( cChar, nStartPos );
546 return (nIndex < 0) ? rStr.getLength() : nIndex;
549 OUString lclTrimQuotedStringList(
const OUString& rStr )
553 sal_Int32 nLen = rStr.getLength();
556 if( rStr[ nPos ] == OOX_DUMP_CFG_QUOTE )
561 OUStringBuffer aToken;
565 sal_Int32 nEnd = lclIndexOf( rStr, OOX_DUMP_CFG_QUOTE, nPos );
566 aToken.append( rStr.subView(nPos, nEnd - nPos) );
568 while( (nEnd + 1 < nLen) && (rStr[ nEnd ] == OOX_DUMP_CFG_QUOTE) && (rStr[ nEnd + 1 ] == OOX_DUMP_CFG_QUOTE) )
570 aToken.append( OOX_DUMP_CFG_QUOTE );
576 while( (nPos < nLen) && (rStr[ nPos ] != OOX_DUMP_CFG_QUOTE) );
578 aBuffer.append( aToken.makeStringAndClear() );
579 nPos = lclIndexOf( rStr, OOX_DUMP_CFG_LISTSEP, nPos );
581 aBuffer.append( OOX_DUMP_LF );
588 sal_Int32 nEnd = lclIndexOf( rStr, OOX_DUMP_CFG_LISTSEP, nPos );
589 aBuffer.append( rStr.subView(nPos, nEnd - nPos) );
591 aBuffer.append( OOX_DUMP_LF );
597 return aBuffer.makeStringAndClear();
605 while( (nBeg < rStr.size()) && ((rStr[ nBeg ] ==
' ') || (rStr[ nBeg ] ==
'\t')) )
607 size_t nEnd = rStr.size();
608 while( (nEnd > nBeg) && ((rStr[ nEnd - 1 ] ==
' ') || (rStr[ nEnd - 1 ] ==
'\t')) )
610 return rStr.substr( nBeg, nEnd - nBeg );
615 sal_Int32 nLastPos = rStr.getLength() - 1;
616 if( (nLastPos >= 0) && (rStr[ nLastPos ] == 0) )
617 return rStr.copy( 0, nLastPos );
629 if ( rStr ==
u"int8" )
631 else if ( rStr ==
u"uint8" )
633 else if ( rStr ==
u"int16" )
635 else if ( rStr ==
u"uint16" )
637 else if ( rStr ==
u"int32" )
639 else if ( rStr ==
u"uint32" )
641 else if ( rStr ==
u"int64" )
643 else if ( rStr ==
u"uint64" )
645 else if ( rStr ==
u"float" )
647 else if ( rStr ==
u"double" )
655 if ( rStr ==
u"dec" )
657 else if ( rStr ==
u"hex" )
659 else if ( rStr ==
u"shorthex" )
661 else if ( rStr ==
u"bin" )
663 else if ( rStr ==
u"fix" )
665 else if ( rStr ==
u"bool" )
673 size_t nLen = rData.size();
675 if( (nLen > 0) && (rData[ 0 ] ==
'-') )
681 for( ; nPos < nLen; ++nPos )
684 if( (cChar <
'0') || (cChar >
'9') )
686 ornData = (ornData * 10) + (cChar -
'0');
696 for(
size_t nPos = 0, nLen = rData.size(); nPos < nLen; ++nPos )
699 if( (
'0' <= cChar) && (cChar <=
'9') )
701 else if( (
'A' <= cChar) && (cChar <=
'F') )
703 else if( (
'a' <= cChar) && (cChar <=
'f') )
707 ornData = (ornData << 4) + cChar;
714 if( (rData.size() > 2) && (rData[ 0 ] ==
'0') && ((rData[ 1 ] ==
'X') || (rData[ 1 ] ==
'x')) )
721 rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok;
725 orfData = rtl_math_uStringToDouble(pBegin,
726 pBegin + rData.size(),
729 nSize =
static_cast<sal_Int32
>(pEnd - pBegin);
730 return (eStatus == rtl_math_ConversionStatus_Ok) && (nSize ==
static_cast<sal_Int32
>(rData.size()));
735 if ( rData ==
u"true" )
737 if ( rData ==
u"false" )
746 if( !rString.isEmpty() )
748 sal_Int32 nEqPos = rString.indexOf( cSep );
751 aPair.first = rString;
765 OUString aUnquotedData = lclTrimQuotedStringList( rData );
767 sal_Int32 nLen = aUnquotedData.getLength();
768 while( (0 <= nPos) && (nPos < nLen) )
770 std::u16string_view aToken =
getToken( aUnquotedData, nPos, OOX_DUMP_LF );
771 if( !bIgnoreEmpty || !aToken.empty() )
772 orVec.push_back( OUString(aToken) );
779 OUString aUnquotedData = lclTrimQuotedStringList( rData );
781 sal_Int32 nLen = aUnquotedData.getLength();
783 while( (0 <= nPos) && (nPos < nLen) )
786 if( !bIgnoreEmpty || bOk )
787 orVec.push_back( bOk ? nData : 0 );
817 while( bLoop && !rStrm.
isEof() )
819 OUString aKey,
aData;
836 while( !rStrm.
isEof() && aLine.isEmpty() )
839 if( !aLine.isEmpty() && (aLine[ 0 ] == OOX_DUMP_BOM) )
840 aLine = aLine.copy( 1 );
842 if( !aLine.isEmpty() )
846 if( (cChar ==
'#') || (cChar ==
';') )
853 orData = aPair.second;
854 return ( !orKey.isEmpty() && (!orData.isEmpty() || orKey !=
"end" )) ?
881 for (
auto const& elem : *rxList)
882 maMap[ elem.first ] = elem.second;
895 if ( rKey ==
"include" )
897 else if ( rKey ==
"exclude" )
911 maMap[ nKey ] = rName;
917 return (aIt ==
end()) ?
nullptr : &aIt->second;
924 for (
auto const& elem : aVec)
932 for (
auto const& elem : aVec)
940 for (
auto const& elemName : *rxNameList)
941 maMap[ elemName.first ].parse( elemName.second );
948 mbQuoteNames(
false )
955 if ( rKey ==
"default" )
957 else if ( rKey ==
"quote-names" )
974 OUStringBuffer aBuffer( aName );
976 aName = aBuffer.makeStringAndClear();
988 if(
const ConstList* pConstList = dynamic_cast< const ConstList* >( &rList ) )
997 mbIgnoreEmpty( true )
1003 sal_Int64 nKey = nStartKey;
1004 for (
auto const&
name : rNames)
1015 if ( rKey ==
"ignore-empty" )
1037 if ( rKey ==
"ignore" )
1051 if( (nKey != 0) && ((nKey & (nKey - 1)) == 0) )
1058 OUStringBuffer
aName;
1062 sal_Int64 nMask = aIt->first;
1066 const OUString& rFlagName = aIt->second;
1067 bool bOnOff = rFlagName.startsWith(
":");
1068 bool bFlag =
getFlag( nKey, nMask );
1072 aName.appendAscii( bFlag ?
":on" :
":off" );
1076 bool bNegated = rFlagName.startsWith(
"!");
1077 sal_Int32 nBothSep = bNegated ? rFlagName.indexOf(
'!', 1 ) : -1;
1082 else if( nBothSep > 0 )
1096 setFlag( nKey, nFound,
false );
1100 aUnknown.append( OOX_DUMP_ITEMSEP );
1105 return aName.makeStringAndClear();
1115 if(
const FlagsList* pFlagsList = dynamic_cast< const FlagsList* >( &rList ) )
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" )
1152 aItemKeys.insert( aKey );
1156 if( aItemKeys.empty() )
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();
1224 if(
const CombiList* pCombiList = dynamic_cast< const CombiList* >( &rList ) )
1247 OUStringBuffer aValue;
1250 return aValue.makeStringAndClear();
1266 const OUString& rSysFileName ) :
1268 mxRootStrg( rxRootStrg ),
1269 maSysFileName( rSysFileName ),
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 ] );
1397 Config::Config(
const char* pcEnvVar,
const FilterBase& rFilter )
1404 construct( pcEnvVar, rxContext, rxRootStrg, rSysFileName );
1413 if( !rFilter.getFileUrl().isEmpty() )
1414 construct( pcEnvVar, rFilter.getComponentContext(), rFilter.getStorage(), rFilter.getFileUrl() );
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 );
1427 return pData ? *pData : rDefault;
1453 return mxCfgData->getNameList( rListName );
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') );
1498 OUStringBuffer aBuffer(
maIndent );
1500 maIndent = aBuffer.makeStringAndClear();
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 ] ==
'#') )
1732 return xStrg && xStrg->isStorage();
1793 bool bIsStrg =
mxStrg->isStorage();
1794 bool bIsRoot =
mxStrg->isRootStorage();
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 const OUString& rStrmName, std::u16string_view rSysOutPath )
1851 OUStringBuffer aBuffer;
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() )
1871 aInStrm.copyToStream( aOutStrm );
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( rData.getLength() );
1975 mxOut->writeAscii(
")," );
1976 OUStringBuffer aValue( rData.subView( 0, ::std::min( rData.getLength(), OOX_DUMP_MAXSTRLEN ) ) );
1978 mxOut->writeString( aValue.makeStringAndClear() );
1979 if( rData.getLength() > 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);
2163 aBuffer[ nCharsRead ] = 0;
2164 aString = OStringToOUString(std::string_view(aBuffer.data()), eTextEnc);
2166 if( bHideTrailingNul )
2174 OUStringBuffer aBuffer;
2175 for( sal_Int32 nIndex = 0; !
mxStrm->isEof() && (nIndex < nLen); ++nIndex )
2177 aBuffer.append( static_cast< sal_Unicode >(
mxStrm->readuInt16() ) );
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 );
2237 OUStringBuffer aBuffer;
2242 nData32 =
mxStrm->readuInt32();
2244 aBuffer.append(
'-' );
2245 nData16 =
mxStrm->readuInt16();
2247 aBuffer.append(
'-' );
2248 nData16 =
mxStrm->readuInt16();
2250 aBuffer.append(
'-' );
2251 nData8 =
mxStrm->readuChar();
2253 nData8 =
mxStrm->readuChar( );
2255 aBuffer.append(
'-' );
2256 for(
int nIndex = 0; nIndex < 6; ++nIndex )
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) )
2410 mxOut->writeString( aOldStartElem.makeStringAndClear().trim() );
2419 aOldStartElem.append( aElem + aText );
2430 if( aOldStartElem.getLength() == 0 )
2433 mxOut->writeString( aOldStartElem.makeStringAndClear() );
2439 mxOut->writeString( aElem );
2441 if( !aText.trim().isEmpty() )
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() )
virtual void implDumpText(TextInputStream &rTextStrm) override
virtual OUString implGetName(const Config &rCfg, sal_Int64 nKey) const override
Returns the name for the passed key.
virtual void implDumpBaseStream(const BinaryInputStreamRef &rxStrm, const OUString &rSysFileName)
bool getBoolOption(const String &rKey, bool bDefault) const
const_iterator end() const
Returns a map iterator pointing one past the last contained name.
XmlStreamObject(const ObjectBase &rParent, const BinaryInputStreamRef &rxStrm, const OUString &rSysFileName)
static LineType readConfigLine(TextInputStream &rStrm, OUString &orKey, OUString &orData)
void writeStringItem(const String &rName, const OUString &rData)
const OUString & getStringOption(const String &rKey, const OUString &rDefault) const
bool isImportEnabled() const
void writeItemName(const String &rItemName)
virtual void implProcessConfigItemInt(TextInputStream &rStrm, sal_Int64 nKey, const OUString &rData) override
const css::uno::Reference< css::uno::XComponentContext > & getContext() const
static void convertStringToStringList(OUStringVector &orVec, const OUString &rData, bool bIgnoreEmpty)
Hexadecimal, as short as possible (no leading zeros).
void construct(const ConfigRef &rxConfig)
static std::u16string_view trimSpaces(std::u16string_view rStr)
static OUStringPair convertStringToPair(const OUString &rString, sal_Unicode cSep= '=')
void writeHex(Type nData, bool bPrefix=true)
void setNamesFromVec(sal_Int64 nStartKey, const OUStringVector &rNames)
bool readConfigFile(const OUString &rFileUrl)
PreferredItemVector maPreferred
UnitConverter(const SharedConfigData &rCfgData)
static std::u16string_view getToken(std::u16string_view rData, sal_Int32 &rnPos, sal_Unicode cSep=OOX_DUMP_LISTSEP)
virtual void implSetName(sal_Int64 nKey, const OUString &rName) override
Sets the name for the passed key.
static void appendBin(OUStringBuffer &rStr, sal_uInt8 nData, bool bDots=true)
virtual bool implIsValid() const override
virtual ~ObjectBase() override
std::unique_ptr< sal_Int32[]> pData
OUString readToChar(sal_Unicode cChar, bool bIncludeChar)
Reads a text portion from the stream until the specified character is found.
static void appendDec(OUStringBuffer &rStr, sal_uInt8 nData, sal_Int32 nWidth=0, sal_Unicode cFill= ' ')
FormatType
Specifiers for the output format of values.
virtual void implIncludeList(const NameListBase &rList)=0
Derived classes insert all names and other settings from the passed list.
bool isDumperEnabled() const
bool isImportEnabled() const
void emptyLine(size_t nCount=1)
virtual ~NameListBase() override
void createUnitConverter(const OUString &rData)
static sal_uInt64 lcl_ConvertDouble(double const f)
void setNameList(const OUString &rListName, const NameListRef &rxList)
::std::vector< OUString > OUStringVector
void implDumpLine(const OUString &rLine, sal_uInt32 nLine)
Boolean ('true' or 'false').
void addPreferredStream(const String &rStrmName)
const NameListRef & getNameList(const Config &rCfg) const
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
static bool convertStringToInt(sal_Int64 &ornData, std::u16string_view rData)
Type getIntOption(const String &rKey, Type nDefault) const
::std::pair< OUString, OUString > OUStringPair
OUString readLine()
Reads a text line from the stream.
virtual void implDump() override
virtual void implProcessConfigItemStr(TextInputStream &rStrm, const OUString &rKey, const OUString &rData) override
virtual bool implIsValid() const override
std::shared_ptr< StorageBase > StorageRef
virtual void implDumpText(TextInputStream &rTextStrm) override
static void appendChar(OUStringBuffer &rStr, sal_Unicode cChar, sal_Int32 nCount)
void readConfigBlockContents(TextInputStream &rStrm)
virtual OUString implGetName(const Config &rCfg, sal_Int64 nKey) const override
Returns the converted value with appended unit name.
#define OOX_DUMP_ERR_STREAM
NameListWrapper maSimpleRecs
static void appendIndex(OUStringBuffer &rStr, sal_Int64 nIdx)
void writeArray(const sal_uInt8 *pnData, std::size_t nSize, sal_Unicode cSep=OOX_DUMP_LISTSEP)
virtual sal_Int64 size() const =0
Implementations return the size of the stream, if possible.
NameListRef getNameList(const String &rListName) const
Wraps a UNO output stream and provides convenient access functions.
virtual ~OutputObjectBase() override
virtual void implProcessConfigItemStr(TextInputStream &rStrm, const OUString &rKey, const OUString &rData)
void construct(const ObjectBase &rParent, const BinaryInputStreamRef &rxBaseStrm, const OUString &rSysFileName, const BinaryInputStreamRef &rxRecStrm, const String &rRecNames, const String &rSimpleRecs)
virtual void implDumpRecordBody()
void createShortList(const OUString &rData)
::std::vector< sal_Int64 > Int64Vector
Floating-point, double precision.
void eraseNameList(const OUString &rListName)
virtual bool implIsValid() const override
OUStringVector::const_iterator maIt
std::shared_ptr< SharedConfigData > mxCfgData
std::shared_ptr< TextInputStream > mxTextStrm
StorageIterator(const StorageRef &rxStrg)
DataType
Specifiers for atomic data types.
Output(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const OUString &rFileName)
void writeDateTimeItem(const String &rName, const css::util::DateTime &rDateTime)
void constructTextStrmObj(rtl_TextEncoding eTextEnc)
void construct(const ObjectBase &rParent, const BinaryInputStreamRef &rxStrm, rtl_TextEncoding eTextEnc, const OUString &rSysFileName)
virtual void implSetName(sal_Int64 nKey, const OUString &rName) override
Sets the name for the passed key.
const OUString & getSysFileName() const
void writeBool(bool bData)
void writeDec(Type nData, sal_Int32 nWidth=0, sal_Unicode cFill= ' ')
virtual OUString implGetNameDbl(const Config &rCfg, double fValue) const override
Returns the converted value with appended unit name.
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
void include(const OUString &rListKeys)
Includes name lists, given in a comma separated list of names of the lists.
static void appendValue(OUStringBuffer &rStr, Type nData, FormatType eFmtType)
virtual void implSetName(sal_Int64 nKey, const OUString &rName) override
Sets the name for the passed key.
virtual bool implIsValid() const override
virtual void implDumpText(TextInputStream &rTextStrm)=0
virtual OUString implGetName(const Config &rCfg, sal_Int64 nKey) const override
Returns the name for the passed key.
bool getFlag(Type nBitField, Type nMask)
Returns true, if at least one of the bits set in nMask is set in nBitField.
virtual void implProcessConfigItemStr(TextInputStream &rStrm, const OUString &rKey, const OUString &rData) override
const String EMPTY_STRING
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.
void writeAscii(const char *pcStr)
virtual void implIncludeList(const NameListBase &rList) override
Inserts all flags from the passed list.
void construct(const ObjectBase &rParent, const StorageRef &rxStrg, const OUString &rSysPath)
const SharedConfigData & mrCfgData
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< StreamDataSequence > mxRecData
virtual ~ConfigItemBase()
void writeGuidItem(const String &rName, const OUString &rGuid)
static bool convertStringToBool(std::u16string_view rData)
Base class for storage access implementations.
css::uno::Reference< css::uno::XComponentContext > mxContext
void writeDecItem(const String &rName, Type nData, const NameListWrapper &rListWrp=NO_LIST)
virtual ~DumperBase() override
void addNameToItem(Type nData, const NameListWrapper &rListWrp)
static bool convertFromDec(sal_Int64 &ornData, std::u16string_view rData)
static void appendShortHex(OUStringBuffer &rStr, sal_uInt8 nData, bool bPrefix=true)
void construct(const ObjectBase &rParent, const BinaryInputStreamRef &rxBaseStrm, const OUString &rSysFileName, const String &rRecNames, const String &rSimpleRecs)
void processConfigItem(TextInputStream &rStrm, const OUString &rKey, const OUString &rData)
virtual void implProcessConfigItemStr(TextInputStream &rStrm, const OUString &rKey, const OUString &rData) override
void insertRawName(sal_Int64 nKey, const OUString &rName)
Inserts the passed name into the internal map.
NameListWrapper maRecNames
constexpr OUStringLiteral OOX_DUMP_ERR_NONAME
virtual void implIncludeList(const NameListBase &rList) override
Inserts all flags from the passed list.
void constructRecObjBase(const BinaryInputStreamRef &rxBaseStrm, const String &rRecNames, const String &rSimpleRecs)
virtual bool implIsValid() const override
SharedConfigData(const OUString &rFileName, const css::uno::Reference< css::uno::XComponentContext > &rxContext, const StorageRef &rxRootStrg, const OUString &rSysFileName)
void writeCharItem(const String &rName, sal_Unicode cData)
static FormatType convertToFormatType(std::u16string_view rStr)
ExtItemFormatMap maFmtMap
::std::vector< sal_Int32 > maColPos
virtual bool implReadRecordHeader(BinaryInputStream &rBaseStrm, sal_Int64 &ornRecId, sal_Int64 &ornRecSize)=0
virtual void implSetName(sal_Int64 nKey, const OUString &rName) override
Sets the name for the passed key.
virtual bool implIsValid() const override
static bool convertStringToDouble(double &orfData, std::u16string_view rData)
virtual bool implIsValid() const override
static OString convertToUtf8(std::u16string_view rStr)
const OUString * implGetOption(const OUString &rKey) const
void setQuoteNames(bool bQuoteNames)
Enables or disables automatic quotation of returned names.
void construct(const ObjectBase &rParent, const OUString &rSysFileName)
virtual sal_Int64 tell() const =0
Implementations return the current stream position, if possible.
FlagsList(const SharedConfigData &rCfgData)
static bool convertFromHex(sal_Int64 &ornData, std::u16string_view rData)
constexpr OUStringLiteral OOX_DUMP_UNKNOWN
void includeList(const NameListRef &rxList)
Include all names of the passed list.
virtual void implDumpStorage(const StorageRef &rxStrg, const OUString &rStrgPath, const OUString &rSysPath)
static void appendString(OUStringBuffer &rStr, const OUString &rData, sal_Int32 nWidth, sal_Unicode cFill= ' ')
static void appendCChar(OUStringBuffer &rStr, sal_Unicode cChar, bool bPrefix=true)
static OUString getSysFileName(const OUString &rStrmName, std::u16string_view rSysOutPath)
void extractStorage(const StorageRef &rxStrg, const OUString &rStrgPath, const OUString &rSysPath)
css::uno::Reference< css::io::XInputStream > openInputStream(const OUString &rStreamName)
Opens and returns the specified input stream from the storage.
void writeArrayItem(const String &rName, const sal_uInt8 *pnData, std::size_t nSize, sal_Unicode cSep=OOX_DUMP_LISTSEP)
ConfigFileSet maConfigFiles
virtual bool implIsValid() const override
void setIgnoreFlags(sal_Int64 nIgnore)
Sets flags to be ignored on output.
void addPreferredStorage(const String &rStrgPath)
static void appendHex(OUStringBuffer &rStr, sal_uInt8 nData, bool bPrefix=true)
virtual ~SharedConfigData() override
virtual void implDump() override
enumrange< T >::Iterator end(enumrange< T >)
void dumpBinaryStream(bool bShowOffset=true)
void writeChar(sal_Unicode cChar, sal_Int32 nCount=1)
void construct(const char *pcEnvVar, const ::oox::core::FilterBase &rFilter)
const sal_Unicode OOX_DUMP_STRQUOTE
virtual ~Config() override
bool isEof() const
Returns true, if no more text is available in the stream.
static void convertStringToIntList(Int64Vector &orVec, const OUString &rData, bool bIgnoreEmpty)
virtual OUString implGetNameDbl(const Config &rCfg, double fValue) const override
Returns the name for the passed double value.
virtual bool implStartRecord(BinaryInputStream &rBaseStrm, sal_Int64 &ornRecPos, sal_Int64 &ornRecId, sal_Int64 &ornRecSize)=0
std::shared_ptr< NameListBase > NameListRef
virtual bool implIsValid() const override
std::unique_ptr< char[]> aBuffer
void writeString(const OUString &rStr)
void startTable(sal_Int32 nW1)
virtual void implSetName(sal_Int64 nKey, const OUString &rName)=0
Derived classes set the name for the passed key.
Base class of all classes providing names for specific values (name lists).
StorageIterator & operator++()
virtual void implSetName(sal_Int64 nKey, const OUString &rName) override
Sets the name for the passed key.
virtual ~StorageIterator() override
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
void writeDateTime(const css::util::DateTime &rDateTime)
void extractStream(StorageBase &rStrg, const OUString &rStrgPath, const OUString &rStrmName, const OUString &rSysFileName)
MultiList(const SharedConfigData &rCfgData)
std::u16string_view trim(std::u16string_view str)
void construct(const ConfigRef &rxConfig)
void resetItemIndex(sal_Int64 nIdx=0)
virtual void implProcessConfigItemStr(TextInputStream &rStrm, const OUString &rKey, const OUString &rData) override
bool isSeekable() const
Returns true, if the implementation supports the seek() operation.
void startItem(const String &rItemName)
NameListRef getNameList(const OUString &rListName) const
static void appendEncString(OUStringBuffer &rStr, const OUString &rData, bool bPrefix=true)
OUString getName(const NameListWrapper &rListWrp, Type nKey) const
Returns the name for the passed key from the passed name list.
CombiList(const SharedConfigData &rCfgData)
static DataType convertToDataType(std::u16string_view rStr)
virtual void implDumpStream(const css::uno::Reference< css::io::XInputStream > &rxStrm, const OUString &rStrgPath, const OUString &rStrmName, const OUString &rSysFileName)
void readConfigBlock(TextInputStream &rStrm)
virtual bool implStartRecord(BinaryInputStream &rBaseStrm, sal_Int64 &ornRecPos, sal_Int64 &ornRecId, sal_Int64 &ornRecSize) override
const OUString * findRawName(sal_Int64 nKey) const
Returns the name for the passed key, or 0, if nothing found.
const OUString * getOption(const OUString &rKey) const
virtual void implIncludeList(const NameListBase &rList) override
Inserts all names from the passed list.
void writeInfoItem(const String &rName, const String &rData)
virtual bool implIsValid() const override
static void appendEncChar(OUStringBuffer &rStr, sal_Unicode cChar, sal_Int32 nCount, bool bPrefix=true)
ConfigDataMap maConfigData
std::shared_ptr< Config > ConfigRef
static void appendToken(OUStringBuffer &rStr, std::u16string_view rToken, sal_Unicode cSep=OOX_DUMP_LISTSEP)
void writeEmptyItem(const String &rName)
BinaryInputStreamRef mxBaseStrm
virtual void implIncludeList(const NameListBase &rList) override
Empty implementation.
bool isEof() const
Returns true, if the stream position is invalid (EOF).
virtual void implProcessConfigItemStr(TextInputStream &rStrm, const OUString &rKey, const OUString &rData) override
TextLineStreamObject(const ObjectBase &rParent, const BinaryInputStreamRef &rxStrm, rtl_TextEncoding eTextEnc, const OUString &rSysFileName)
const StorageRef & getRootStorage() const
Floating-point, single precision.
virtual void implProcessConfigItemInt(TextInputStream &rStrm, sal_Int64 nKey, const OUString &rData)
OUStringMap::const_iterator const_iterator
BinaryStreamObject(const ObjectBase &rParent, const BinaryInputStreamRef &rxStrm, const OUString &rSysFileName)
void setName(sal_Int64 nKey, const String &rName)
Sets a name for the specified key.
void eraseNameList(const String &rListName)
static void appendBool(OUStringBuffer &rStr, bool bData)
void extractItem(const StorageRef &rxStrg, const OUString &rStrgPath, const OUString &rItemName, std::u16string_view rSysPath, bool bIsStrg, bool bIsStrm)
virtual OUString implGetNameDbl(const Config &rCfg, double fValue) const override
Returns the name for the passed double value.
virtual void implDump() override
No numeric format (e.g. show name only).
virtual void implWriteExtHeader()
static OUString trimTrailingNul(const OUString &rStr)
void writeShortHexItem(const String &rName, Type nData, const NameListWrapper &rListWrp=NO_LIST)
void exclude(const OUString &rKeys)
Excludes names from the list, given in a comma separated list of their keys.
constexpr OUStringLiteral OOX_DUMP_UNUSED
static void enclose(OUStringBuffer &rStr, sal_Unicode cOpen, sal_Unicode cClose= '\0')
Encloses the passed string with the passed characters.
const_iterator begin() const
Returns a map iterator pointing to the first contained name.
bool m_bDetectedRangeSegmentation false
ConstList(const SharedConfigData &rCfgData)
virtual void implDump() override
css::uno::Reference< css::io::XTextOutputStream2 > mxStrm