zxing-cpp: strip to core library only (remove tests/wrappers/examples/docs); .gitignore: fix /core to allow zxing-cpp/core/ dir
This commit is contained in:
1 parent
22c24d135e
commit
8051dfe4e5
2506 files changed
+57271
-30087
No files matched your search
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2016 Nu-book Inc.
|
||||
*/
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CharacterSet.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace ZXing {
|
||||
|
||||
class TextEncoder
|
||||
{
|
||||
static void GetBytes(const std::string& str, CharacterSet charset, std::string& bytes);
|
||||
static void GetBytes(const std::wstring& str, CharacterSet charset, std::string& bytes);
|
||||
public:
|
||||
static std::string FromUnicode(const std::string& str, CharacterSet charset) {
|
||||
std::string r;
|
||||
GetBytes(str, charset, r);
|
||||
return r;
|
||||
}
|
||||
static std::string FromUnicode(const std::wstring& str, CharacterSet charset) {
|
||||
std::string r;
|
||||
GetBytes(str, charset, r);
|
||||
return r;
|
||||
}
|
||||
};
|
||||
|
||||
} // ZXing
|
||||
Reference in new issue
Block a user