merge the formfield patch from ooo-build
[ooovba.git] / configmgr / source / inc / strings.hxx
blob238eb1de93e32916774c26debb1558b2be074e57
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: strings.hxx,v $
10 * $Revision: 1.6 $
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 _CONFIGMGR_STRINGS_HXX_
32 #define _CONFIGMGR_STRINGS_HXX_
34 #include <sal/types.h>
35 #include <rtl/ustring.hxx>
38 //.........................................................................
39 namespace configmgr
41 //.........................................................................
43 struct UStringDescription
45 const sal_Char* m_pZeroTerminatedName;
46 sal_Int32 m_nLen;
47 rtl_TextEncoding m_encoding;
49 UStringDescription(const sal_Char* _pName, sal_Int32 _nLen, rtl_TextEncoding _encoding)
50 : m_pZeroTerminatedName( _pName )
51 , m_nLen( _nLen )
52 , m_encoding(_encoding )
53 , m_aString (_pName, _nLen, _encoding)
57 sal_Int32 getLength() const { return m_nLen; }
58 operator ::rtl::OUString const&() const { return m_aString; }
59 operator const sal_Char*() const { return m_pZeroTerminatedName; }
61 private:
62 rtl::OUString m_aString;
63 UStringDescription();
66 #define DECLARE_CONSTASCII_USTRING(name) \
67 extern ::configmgr::UStringDescription name
69 #define IMPLEMENT_CONSTASCII_USTRING(name, asciivalue) \
70 ::configmgr::UStringDescription name(RTL_CONSTASCII_USTRINGPARAM(asciivalue))
72 //.........................................................................
73 } // namespace frm
74 //.........................................................................
76 #endif // _CONFIGMGR_STRINGS_HXX_