1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _STRINGCONVERSIONTOOLS_HXX
20 #define _STRINGCONVERSIONTOOLS_HXX
22 #include <sal/types.h>
23 #include <rtl/ustring.hxx>
24 #include <rtl/ustrbuf.hxx>
30 void lcl_skipSpaces(sal_Int32
& io_rPos
,
32 const sal_Int32 nLen
);
34 void lcl_skipSpacesAndCommas(sal_Int32
& io_rPos
,
36 const sal_Int32 nLen
);
38 inline bool lcl_isOnNumberChar(const sal_Unicode aChar
, bool bSignAllowed
= true)
40 const bool bPredicate( (sal_Unicode('0') <= aChar
&& sal_Unicode('9') >= aChar
)
41 || (bSignAllowed
&& sal_Unicode('+') == aChar
)
42 || (bSignAllowed
&& sal_Unicode('-') == aChar
) );
47 inline bool lcl_isOnNumberChar(const OUString
& rStr
, const sal_Int32 nPos
, bool bSignAllowed
= true)
49 return lcl_isOnNumberChar(rStr
[nPos
],
53 bool lcl_getDoubleChar(double& o_fRetval
,
55 const OUString
& rStr
);
57 bool lcl_importDoubleAndSpaces( double& o_fRetval
,
60 const sal_Int32 nLen
);
62 bool lcl_importFlagAndSpaces(sal_Int32
& o_nRetval
,
65 const sal_Int32 nLen
);
67 void lcl_skipNumber(sal_Int32
& io_rPos
,
69 const sal_Int32 nLen
);
71 void lcl_skipDouble(sal_Int32
& io_rPos
,
72 const OUString
& rStr
);
74 inline void lcl_putNumberChar( OUStringBuffer
& rStr
,
77 rStr
.append( fValue
);
80 void lcl_putNumberCharWithSpace( OUStringBuffer
& rStr
,
83 bool bUseRelativeCoordinates
);
85 inline sal_Unicode
lcl_getCommand( sal_Char cUpperCaseCommand
,
86 sal_Char cLowerCaseCommand
,
87 bool bUseRelativeCoordinates
)
89 return bUseRelativeCoordinates
? cLowerCaseCommand
: cUpperCaseCommand
;
91 } // namespace internal
92 } // namespace basegfx
94 #endif /* _STRINGCONVERSIONTOOLS_HXX */
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */