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 ");
99 aStrBuf.append(OString::number(
nRadius) +
" ");
107 OStringBuffer aStrBuf(
"circle ");
118 OStringBuffer aStrBuf(
"polygon ");
131 OStringBuffer aStrBuf(
"poly ");
251 const char* pStr =
aStr.getStr();
252 char cChar = *pStr++;
256 while ((cChar >=
'a') && (cChar <=
'z'))
261 OString aToken =
aBuf.makeStringAndClear();
266 if ( ( aToken ==
"rectangle" ) || ( aToken ==
"rect" ) )
275 else if ( ( aToken ==
"circle" ) || ( aToken ==
"circ" ) )
283 else if ( ( aToken ==
"polygon" ) || ( aToken ==
"poly" ) )
288 for ( sal_uInt16
i = 0;
i <
nCount;
i++ )
299 OUStringBuffer aStrX;
300 OUStringBuffer aStrY;
302 char cChar = *(*ppStr)++;
304 while(
NOTEOL( cChar ) && ( ( cChar <
'0' ) || ( cChar >
'9' ) ) )
309 while(
NOTEOL( cChar ) && ( cChar >=
'0' ) && ( cChar <=
'9' ) )
311 aStrX.append( cChar );
317 while(
NOTEOL( cChar ) && ( ( cChar <
'0' ) || ( cChar >
'9' ) ) )
320 while(
NOTEOL( cChar ) && ( cChar >=
'0' ) && ( cChar <=
'9' ) )
322 aStrY.append( cChar );
327 while(
NOTEOL( cChar ) && ( cChar !=
')' ) )
340 char cChar = *(*ppStr)++;
342 while(
NOTEOL( cChar ) && ( ( cChar <
'0' ) || ( cChar >
'9' ) ) )
347 while(
NOTEOL( cChar ) && ( cChar >=
'0' ) && ( cChar <=
'9' ) )
349 aStr.append( cChar );
359 OUString
aStr(OUString::createFromAscii(*ppStr));
384 const char* pStr =
aStr.getStr();
385 char cChar = *pStr++;
389 while ((cChar >=
'a') && (cChar <=
'z'))
394 OString aToken =
aBuf.makeStringAndClear();
399 if ( aToken ==
"rect" )
408 else if ( aToken ==
"circle" )
417 else if ( aToken ==
"poly" )
423 for ( sal_uInt16
i = 0;
i <
nCount;
i++ )
433 char cChar = *(*ppStr)++;
435 while(
NOTEOL( cChar ) && ( ( cChar ==
' ' ) || ( cChar ==
'\t' ) ) )
440 while(
NOTEOL( cChar ) && ( cChar !=
' ' ) && ( cChar !=
'\t' ) )
442 aStr.append( cChar );
452 OUStringBuffer aStrX;
453 OUStringBuffer aStrY;
455 char cChar = *(*ppStr)++;
457 while(
NOTEOL( cChar ) && ( ( cChar <
'0' ) || ( cChar >
'9' ) ) )
462 while(
NOTEOL( cChar ) && ( cChar >=
'0' ) && ( cChar <=
'9' ) )
464 aStrX.append( cChar );
470 while(
NOTEOL( cChar ) && ( ( cChar <
'0' ) || ( cChar >
'9' ) ) )
473 while(
NOTEOL( cChar ) && ( cChar >=
'0' ) && ( cChar <=
'9' ) )
475 aStrY.append( cChar );
496 if ( memcmp( cMagic,
IMAPMAGIC,
sizeof( cMagic ) ) )
506 if ( (
aStr.indexOf(
"rect") != -1) ||
507 (
aStr.indexOf(
"circ") != -1) ||
508 (
aStr.indexOf(
"poly") != -1) )
510 if ( (
aStr.indexOf(
'(') != -1 ) &&
511 (
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
constexpr tools::Long Y() const
constexpr tools::Long X() 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)