deskflow/src/lib/arch/IArchString.h

59 lines
1.6 KiB
C
Raw Normal View History

2012-06-10 16:50:54 +00:00
/*
* Deskflow -- mouse and keyboard sharing utility
2025-01-29 01:33:26 +00:00
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
2012-06-10 16:50:54 +00:00
*/
#pragma once
#include "common/IInterface.h"
2025-01-11 02:14:00 +00:00
#include "common/common.h"
2012-06-10 16:50:54 +00:00
#include <stdarg.h>
//! Interface for architecture dependent string operations
/*!
This interface defines the string operations required by
deskflow. Each architecture must implement this interface.
2012-06-10 16:50:54 +00:00
*/
class IArchString : public IInterface
{
2012-06-10 16:50:54 +00:00
public:
IArchString() = default;
IArchString(const IArchString &) = delete;
IArchString(IArchString &&) = delete;
virtual ~IArchString();
2012-06-10 16:50:54 +00:00
IArchString &operator=(const IArchString &) = delete;
IArchString &operator=(IArchString &&) = delete;
2020-11-03 10:52:56 +00:00
//! Wide character encodings
/*!
The known wide character encodings
*/
enum EWideCharEncoding
{
kUCS2, //!< The UCS-2 encoding
kUCS4, //!< The UCS-4 encoding
kUTF16, //!< The UTF-16 encoding
kUTF32, //!< The UTF-32 encoding
kPlatformDetermined
};
2012-06-10 16:50:54 +00:00
//! @name manipulators
//@{
2012-06-10 16:50:54 +00:00
//! Convert multibyte string to wide character string
2025-01-11 02:13:19 +00:00
virtual int convStringMBToWC(wchar_t *, const char *, uint32_t n, bool *errors);
2012-06-10 16:50:54 +00:00
//! Convert wide character string to multibyte string
2025-01-11 02:13:19 +00:00
virtual int convStringWCToMB(char *, const wchar_t *, uint32_t n, bool *errors);
2012-06-10 16:50:54 +00:00
//! Return the architecture's native wide character encoding
virtual EWideCharEncoding getWideCharEncoding() = 0;
2012-06-10 16:50:54 +00:00
//@}
2012-06-10 16:50:54 +00:00
};