2012-06-10 16:50:54 +00:00
|
|
|
/*
|
2024-09-17 19:00:25 +00:00
|
|
|
* Deskflow -- mouse and keyboard sharing utility
|
2025-01-29 01:33:26 +00:00
|
|
|
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
|
2025-01-24 00:11:17 +00:00
|
|
|
* 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
|
|
|
*/
|
|
|
|
|
|
2014-02-28 12:36:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
2025-03-19 22:11:47 +00:00
|
|
|
#include "common/Common.h"
|
2014-02-28 12:36:45 +00:00
|
|
|
#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
|
2024-09-17 19:00:25 +00:00
|
|
|
deskflow. Each architecture must implement this interface.
|
2012-06-10 16:50:54 +00:00
|
|
|
*/
|
2025-05-22 21:55:40 +00:00
|
|
|
class ArchString : public IInterface
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2012-06-10 16:50:54 +00:00
|
|
|
public:
|
2025-05-22 21:55:40 +00:00
|
|
|
ArchString() = default;
|
|
|
|
|
ArchString(const ArchString &) = delete;
|
|
|
|
|
ArchString(ArchString &&) = delete;
|
|
|
|
|
~ArchString() override;
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2025-05-22 21:55:40 +00:00
|
|
|
ArchString &operator=(const ArchString &) = delete;
|
|
|
|
|
ArchString &operator=(ArchString &&) = delete;
|
2020-11-03 10:52:56 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
//! Wide character encodings
|
|
|
|
|
/*!
|
|
|
|
|
The known wide character encodings
|
|
|
|
|
*/
|
2025-05-22 20:33:32 +00:00
|
|
|
enum class EWideCharEncoding : uint8_t
|
2024-10-17 18:04:35 +00:00
|
|
|
{
|
2024-07-02 19:07:06 +00:00
|
|
|
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
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
//! @name manipulators
|
|
|
|
|
//@{
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
//! Convert multibyte string to wide character string
|
2025-05-22 21:55:40 +00:00
|
|
|
int convStringMBToWC(wchar_t *, const char *, uint32_t n, bool *errors) const;
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
//! Convert wide character string to multibyte string
|
2025-05-22 21:55:40 +00:00
|
|
|
int convStringWCToMB(char *, const wchar_t *, uint32_t n, bool *errors) const;
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
//! Return the architecture's native wide character encoding
|
2025-05-22 21:55:40 +00:00
|
|
|
EWideCharEncoding getWideCharEncoding() const;
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
//@}
|
2012-06-10 16:50:54 +00:00
|
|
|
};
|