mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Added love.math.encode(format, data | string [, linelength]) and love.math.decode(format, data | string). Current formats are "base64" and "hex". The optional line length only applies to base64 and specifies the maximum number of characters per line in the encoded string.
Removed the variant of love.filesystem.newFileData which decoded a base64-encoded string since it's redundant. --HG-- branch : minor
This commit is contained in:
@@ -22,10 +22,11 @@
|
||||
#define LOVE_FILESYSTEM_FILE_DATA_H
|
||||
|
||||
// LOVE
|
||||
#include <string>
|
||||
#include "common/Data.h"
|
||||
#include "common/StringMap.h"
|
||||
#include "common/int.h"
|
||||
#include "common/Exception.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace love
|
||||
{
|
||||
@@ -36,13 +37,6 @@ class FileData : public Data
|
||||
{
|
||||
public:
|
||||
|
||||
enum Decoder
|
||||
{
|
||||
FILE,
|
||||
BASE64,
|
||||
DECODE_MAX_ENUM
|
||||
}; // Decoder
|
||||
|
||||
FileData(uint64 size, const std::string &filename);
|
||||
|
||||
virtual ~FileData();
|
||||
@@ -54,9 +48,6 @@ public:
|
||||
const std::string &getFilename() const;
|
||||
const std::string &getExtension() const;
|
||||
|
||||
static bool getConstant(const char *in, Decoder &out);
|
||||
static bool getConstant(Decoder in, const char *&out);
|
||||
|
||||
private:
|
||||
|
||||
// The actual data.
|
||||
@@ -71,9 +62,6 @@ private:
|
||||
// The extension (without dot). Used to identify file type.
|
||||
std::string extension;
|
||||
|
||||
static StringMap<Decoder, DECODE_MAX_ENUM>::Entry decoderEntries[];
|
||||
static StringMap<Decoder, DECODE_MAX_ENUM> decoders;
|
||||
|
||||
}; // FileData
|
||||
|
||||
} // filesystem
|
||||
|
||||
Reference in New Issue
Block a user