24#include <rtl/strbuf.hxx>
38#define NOTEOL(c) ((c)!='\0')
45 rBuf.append(
static_cast<sal_Int32
>(aPixPt.X()));
47 rBuf.append(
static_cast<sal_Int32
>(aPixPt.Y()));
55 rBuf.append(
static_cast<sal_Int32
>(aPixPt.X()));
57 rBuf.append(
static_cast<sal_Int32
>(aPixPt.Y()));
74 OStringBuffer aStrBuf(
"rectangle ");
85 OStringBuffer aStrBuf(
"rect ");
96 OStringBuffer aStrBuf(
"circle ");
108 OStringBuffer aStrBuf(
"circle ");
119 OStringBuffer aStrBuf(
"polygon ");
132 OStringBuffer aStrBuf(
"poly ");
252 const char* pStr =
aStr.getStr();
253 char cChar = *pStr++;
257 while ((cChar >=
'a') && (cChar <=
'z'))
262 OString aToken =
aBuf.makeStringAndClear();
267 if ( ( aToken ==
"rectangle" ) || ( aToken ==
"rect" ) )
276 else if ( ( aToken ==
"circle" ) || ( aToken ==
"circ" ) )
284 else if ( ( aToken ==
"polygon" ) || ( aToken ==
"poly" ) )
289 for ( sal_uInt16
i = 0;
i <
nCount;
i++ )
300 OUStringBuffer aStrX;
301 OUStringBuffer aStrY;
303 char cChar = *(*ppStr)++;
305 while(
NOTEOL( cChar ) && ( ( cChar <
'0' ) || ( cChar >
'9' ) ) )
310 while(
NOTEOL( cChar ) && ( cChar >=
'0' ) && ( cChar <=
'9' ) )
312 aStrX.append( cChar );
318 while(
NOTEOL( cChar ) && ( ( cChar <
'0' ) || ( cChar >
'9' ) ) )
321 while(
NOTEOL( cChar ) && ( cChar >=
'0' ) && ( cChar <=
'9' ) )
323 aStrY.append( cChar );
328 while(
NOTEOL( cChar ) && ( cChar !=
')' ) )
341 char cChar = *(*ppStr)++;
343 while(
NOTEOL( cChar ) && ( ( cChar <
'0' ) || ( cChar >
'9' ) ) )
348 while(
NOTEOL( cChar ) && ( cChar >=
'0' ) && ( cChar <=
'9' ) )
350 aStr.append( cChar );
360 OUString
aStr(OUString::createFromAscii(*ppStr));
385 const char* pStr =
aStr.getStr();
386 char cChar = *pStr++;
390 while ((cChar >=
'a') && (cChar <=
'z'))
395 OString aToken =
aBuf.makeStringAndClear();
400 if ( aToken ==
"rect" )
409 else if ( aToken ==
"circle" )
418 else if ( aToken ==
"poly" )
424 for ( sal_uInt16
i = 0;
i <
nCount;
i++ )
434 char cChar = *(*ppStr)++;
436 while(
NOTEOL( cChar ) && ( ( cChar ==
' ' ) || ( cChar ==
'\t' ) ) )
441 while(
NOTEOL( cChar ) && ( cChar !=
' ' ) && ( cChar !=
'\t' ) )
443 aStr.append( cChar );
453 OUStringBuffer aStrX;
454 OUStringBuffer aStrY;
456 char cChar = *(*ppStr)++;
458 while(
NOTEOL( cChar ) && ( ( cChar <
'0' ) || ( cChar >
'9' ) ) )
463 while(
NOTEOL( cChar ) && ( cChar >=
'0' ) && ( cChar <=
'9' ) )
465 aStrX.append( cChar );
471 while(
NOTEOL( cChar ) && ( ( cChar <
'0' ) || ( cChar >
'9' ) ) )
474 while(
NOTEOL( cChar ) && ( cChar >=
'0' ) && ( cChar <=
'9' ) )
476 aStrY.append( cChar );
497 if ( memcmp( cMagic,
IMAPMAGIC,
sizeof( cMagic ) ) )
507 if ( (
aStr.indexOf(
"rect") != -1) ||
508 (
aStr.indexOf(
"circ") != -1) ||
509 (
aStr.indexOf(
"poly") != -1) )
511 if ( (
aStr.indexOf(
'(') != -1 ) &&
512 (
aStr.indexOf(
')') != -1 ) )
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
void WriteCERN(SvStream &rOStm) const
void WriteNCSA(SvStream &rOStm) const
void AppendNCSAURL(OStringBuffer &rBuf) const
virtual IMapObjectType GetType() const =0
void AppendCERNURL(OStringBuffer &rBuf) const
static void AppendNCSACoords(OStringBuffer &rBuf, const Point &rPoint100)
static void AppendCERNCoords(OStringBuffer &rBuf, const Point &rPoint100)
void WriteCERN(SvStream &rOStm) const
void WriteNCSA(SvStream &rOStm) const
void WriteNCSA(SvStream &rOStm) const
void WriteCERN(SvStream &rOStm) const
static OUString GetAbsURL(std::u16string_view rTheBaseURIRef, OUString const &rTheRelURIRef, EncodeMechanism eEncodeMechanism=EncodeMechanism::WasEncoded, DecodeMechanism eDecodeMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
void ImpReadCERN(SvStream &rOStm)
void ImpReadCERNLine(std::string_view rLine)
void ImpReadNCSA(SvStream &rOStm)
static Point ImpReadCERNCoords(const char **ppStr)
void Write(SvStream &rOStm) const
static OUString ImpReadNCSAURL(const char **ppStr)
void ImpWriteCERN(SvStream &rOStm) const
void ImpReadNCSALine(std::string_view rLine)
std::vector< std::unique_ptr< IMapObject > > maList
void Read(SvStream &rIStm)
static Point ImpReadNCSACoords(const char **ppStr)
static IMapFormat ImpDetectFormat(SvStream &rIStm)
static OUString ImpReadCERNURL(const char **ppStr)
static tools::Long ImpReadCERNRadius(const char **ppStr)
void ImpWriteNCSA(SvStream &rOStm) const
bool WriteLine(std::string_view rStr)
bool ReadLine(OStringBuffer &rStr, sal_Int32 nMaxBytesToRead=0xFFFE)
sal_uInt64 Seek(sal_uInt64 nPos)
std::size_t ReadBytes(void *pData, std::size_t nSize)
SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative(OUString const &baseUriReference, OUString const &uriReference)
OString strip(const OString &rIn, char c)
OString stripStart(const OString &rIn, char c)
sal_Int32 getTokenCount(std::string_view rIn, char cTok)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)