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>
35 #include <rtl/ustring.hxx>
36 #include <rtl/string.hxx>
37 #include <rtl/tencinfo.h>
38 #include <rtl/textcvt.h>
45 * string convenience routines
46 * sizeof(pBuffer) must be at least 2 Bytes, 0x00 <= nValue <= 0xFF,
47 * effective buffer of get*ValueOf() is NOT NULL-terminated
49 sal_Int32
getHexValueOf (sal_Int32 nValue
, sal_Char
* pBuffer
);
50 sal_Int32
getAlignedHexValueOf (sal_Int32 nValue
, sal_Char
* pBuffer
);
51 sal_Int32
getValueOf (sal_Int32 nValue
, sal_Char
* pBuffer
);
52 sal_Int32
appendStr (const sal_Char
* pSrc
, sal_Char
* pDst
);
53 sal_Int32
appendStr (const sal_Char
* pSrc
, sal_Char
* pDst
, sal_Int32 nBytes
);
55 sal_Bool
WritePS (osl::File
* pFile
, const sal_Char
* pString
);
56 sal_Bool
WritePS (osl::File
* pFile
, const sal_Char
* pString
, sal_uInt64 nInLength
);
57 sal_Bool
WritePS (osl::File
* pFile
, const rtl::OString
&rString
);
58 sal_Bool
WritePS (osl::File
* pFile
, const rtl::OUString
&rString
);
60 class ConverterFactory
66 rtl_UnicodeToTextConverter
Get (rtl_TextEncoding nEncoding
);
67 sal_Size
Convert (const sal_Unicode
*pText
, int nTextLen
,
68 sal_uChar
*pBuffer
, sal_Size nBufferSize
,
69 rtl_TextEncoding nEncoding
);
72 std::map
< rtl_TextEncoding
, rtl_UnicodeToTextConverter
> m_aConverters
;
75 ConverterFactory
* GetConverterFactory ();
79 #endif /* _PSPRINT_PRINTERUTIL_HXX_ */