deskflow/src/lib/arch/ArchString.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/Common.h"
#include "common/IInterface.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 ArchString : public IInterface
{
2012-06-10 16:50:54 +00:00
public:
ArchString() = default;
ArchString(const ArchString &) = delete;
ArchString(ArchString &&) = delete;
~ArchString() override = default;
2012-06-10 16:50:54 +00:00
ArchString &operator=(const ArchString &) = delete;
ArchString &operator=(ArchString &&) = delete;
2020-11-03 10:52:56 +00:00
//! Wide character encodings
/*!
The known wide character encodings
*/
enum class EWideCharEncoding : uint8_t
{
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
int convStringMBToWC(wchar_t *, const char *, uint32_t n, bool *errors) const;
2012-06-10 16:50:54 +00:00
//! Convert wide character string to multibyte string
int convStringWCToMB(char *, const wchar_t *, uint32_t n, bool *errors) const;
2012-06-10 16:50:54 +00:00
//! Return the architecture's native wide character encoding
EWideCharEncoding getWideCharEncoding() const;
2012-06-10 16:50:54 +00:00
//@}
2012-06-10 16:50:54 +00:00
};