Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMMON: Don't include win32.h in common/encoding.h #1828

Merged
merged 1 commit into from
Sep 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion backends/platform/sdl/win32/win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "backends/platform/sdl/win32/win32-window.h"

class OSystem_Win32 : public OSystem_SDL {
friend class Common::Encoding;
public:
virtual void init();
virtual void initBackend();
Expand Down
29 changes: 11 additions & 18 deletions common/encoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
#include "common/system.h"


#ifdef WIN32
#include "backends/platform/sdl/win32/win32.h"
#endif

namespace Common {

/**
Expand All @@ -40,9 +36,6 @@ namespace Common {
* ScummVM is compiled with or without iconv.
*/
class Encoding {
#ifdef WIN32
friend char *OSystem_Win32::convertEncoding(const char*, const char *, const char *, size_t);
#endif
public:
/**
* Constructs everything needed for the conversion between 2 encodings
Expand Down Expand Up @@ -104,6 +97,17 @@ class Encoding {
* @param to The encoding, to convert to
*/
void setTo(const String &to) {_to = to;};

/**
* Switches the endianity of a string.
*
* @param string Array containing the characters of a string.
* @param length Length of the string in bytes
* @param bitCount Number of bits used for each character.
*
* @return Array of characters with the opposite endianity
*/
static char *switchEndian(const char *string, int length, int bitCount);

private:
/** The encoding, which is currently being converted to */
Expand Down Expand Up @@ -195,17 +199,6 @@ class Encoding {
* @return Transliterated string in UTF-32 (must be freed) or nullptr on fail.
*/
static uint32 *transliterateUTF32(const uint32 *string, size_t length);

/**
* Switches the endianity of a string.
*
* @param string Array containing the characters of a string.
* @param length Length of the string in bytes
* @param bitCount Number of bits used for each character.
*
* @return Array of characters with the opposite endianity
*/
static char *switchEndian(const char *string, int length, int bitCount);
};

}
Expand Down