1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: psputil.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _PSPRINT_PRINTERUTIL_HXX_
32 #define _PSPRINT_PRINTERUTIL_HXX_
34 #include "osl/file.hxx"
36 #include "rtl/ustring.hxx"
37 #include "rtl/string.hxx"
38 #include "rtl/tencinfo.h"
39 #include "rtl/textcvt.h"
46 * string convenience routines
47 * sizeof(pBuffer) must be at least 2 Bytes, 0x00 <= nValue <= 0xFF,
48 * effective buffer of get*ValueOf() is NOT NULL-terminated
50 sal_Int32
getHexValueOf (sal_Int32 nValue
, sal_Char
* pBuffer
);
51 sal_Int32
getAlignedHexValueOf (sal_Int32 nValue
, sal_Char
* pBuffer
);
52 sal_Int32
getValueOf (sal_Int32 nValue
, sal_Char
* pBuffer
);
53 sal_Int32
appendStr (const sal_Char
* pSrc
, sal_Char
* pDst
);
54 sal_Int32
appendStr (const sal_Char
* pSrc
, sal_Char
* pDst
, sal_Int32 nBytes
);
56 sal_Bool
WritePS (osl::File
* pFile
, const sal_Char
* pString
);
57 sal_Bool
WritePS (osl::File
* pFile
, const sal_Char
* pString
, sal_uInt64 nInLength
);
58 sal_Bool
WritePS (osl::File
* pFile
, const rtl::OString
&rString
);
59 sal_Bool
WritePS (osl::File
* pFile
, const rtl::OUString
&rString
);
61 class ConverterFactory
67 rtl_UnicodeToTextConverter
Get (rtl_TextEncoding nEncoding
);
68 sal_Size
Convert (const sal_Unicode
*pText
, int nTextLen
,
69 sal_uChar
*pBuffer
, sal_Size nBufferSize
,
70 rtl_TextEncoding nEncoding
);
73 std::map
< rtl_TextEncoding
, rtl_UnicodeToTextConverter
> m_aConverters
;
76 ConverterFactory
* GetConverterFactory ();
80 #endif /* _PSPRINT_PRINTERUTIL_HXX_ */