2004-04-07 04:54:36 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-07 13:39:50 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-04-07 04:54:36 -05:00
|
|
|
*
|
2005-09-07 13:39:50 -05:00
|
|
|
* $RCSfile: utilities.hxx,v $
|
2004-04-07 04:54:36 -05:00
|
|
|
*
|
2007-01-02 09:12:16 -06:00
|
|
|
* $Revision: 1.6 $
|
2004-04-07 04:54:36 -05:00
|
|
|
*
|
2007-01-02 09:12:16 -06:00
|
|
|
* last change: $Author: hr $ $Date: 2007-01-02 16:12:16 $
|
2004-04-07 04:54:36 -05:00
|
|
|
*
|
2005-09-07 13:39:50 -05:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2004-04-07 04:54:36 -05:00
|
|
|
*
|
|
|
|
*
|
2005-09-07 13:39:50 -05:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2004-04-07 04:54:36 -05:00
|
|
|
*
|
2005-09-07 13:39:50 -05:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2004-04-07 04:54:36 -05:00
|
|
|
*
|
2005-09-07 13:39:50 -05:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2004-04-07 04:54:36 -05:00
|
|
|
*
|
2005-09-07 13:39:50 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
2004-04-07 04:54:36 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef UTILITIES_HXX_INCLUDED
|
|
|
|
#define UTILITIES_HXX_INCLUDED
|
|
|
|
|
2004-09-08 08:24:55 -05:00
|
|
|
#include <malloc.h>
|
2006-06-19 08:14:19 -05:00
|
|
|
#if defined _MSC_VER
|
|
|
|
#pragma warning(push, 1)
|
|
|
|
#endif
|
2004-09-08 08:24:55 -05:00
|
|
|
#include <windows.h>
|
2006-06-19 08:14:19 -05:00
|
|
|
#if defined _MSC_VER
|
|
|
|
#pragma warning(pop)
|
|
|
|
#endif
|
2004-09-08 08:24:55 -05:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <io.h>
|
|
|
|
|
|
|
|
#ifndef TYPES_HXX_INCLUDED
|
|
|
|
#include "internal/types.hxx"
|
|
|
|
#endif
|
|
|
|
|
2004-04-07 04:54:36 -05:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
//---------------------------------
|
|
|
|
/** Convert a string to a wstring
|
|
|
|
using CP_ACP
|
|
|
|
*/
|
|
|
|
std::wstring StringToWString(const std::string& String);
|
|
|
|
|
|
|
|
//---------------------------------
|
|
|
|
/** Convert a wstring to a string
|
|
|
|
using CP_ACP
|
|
|
|
*/
|
|
|
|
std::string WStringToString(const std::wstring& String);
|
|
|
|
|
|
|
|
//---------------------------------
|
|
|
|
/** Retrieve a string from the
|
|
|
|
resources of this module
|
|
|
|
*/
|
|
|
|
std::wstring GetResString(int ResId);
|
|
|
|
|
|
|
|
//---------------------------------
|
|
|
|
/** Returns whether we are running
|
|
|
|
on Windows XP or not
|
|
|
|
*/
|
2007-01-02 09:12:16 -06:00
|
|
|
bool is_windows_xp_or_above();
|
2004-04-07 04:54:36 -05:00
|
|
|
|
2004-09-08 08:24:55 -05:00
|
|
|
//---------------------------------
|
|
|
|
/** helper function to judge if the string is only has spaces.
|
|
|
|
@returns
|
|
|
|
<TRUE>if the provided string contains only but at least one space
|
|
|
|
character else <FALSE/>.
|
|
|
|
*/
|
|
|
|
bool HasOnlySpaces(const std::wstring& String);
|
|
|
|
|
|
|
|
/** convert LocaleSet pair into Windows LCID identifier.
|
|
|
|
@returns
|
|
|
|
Windows Locale Identifier corresponding to input LocaleSet.
|
|
|
|
*/
|
|
|
|
|
|
|
|
LCID LocaleSetToLCID( const LocaleSet_t & Locale );
|
|
|
|
|
2004-04-07 04:54:36 -05:00
|
|
|
#endif
|