mirror of https://github.com/kiwix/libkiwix.git
Merge pull request #90 from kiwix/fix_resource_script
[resource_compiler] Make the exception public.
This commit is contained in:
commit
41e3707f1b
|
@ -106,16 +106,8 @@ master_c_template = """//This file is automaically generated. Do not modify it.
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <stdexcept>
|
|
||||||
#include "{include_file}"
|
#include "{include_file}"
|
||||||
|
|
||||||
class ResourceNotFound : public std::runtime_error {{
|
|
||||||
public:
|
|
||||||
ResourceNotFound(const std::string& what_arg):
|
|
||||||
std::runtime_error(what_arg)
|
|
||||||
{{ }};
|
|
||||||
}};
|
|
||||||
|
|
||||||
static std::string init_resource(const char* name, const unsigned char* content, int len)
|
static std::string init_resource(const char* name, const unsigned char* content, int len)
|
||||||
{{
|
{{
|
||||||
char * resPath = getenv(name);
|
char * resPath = getenv(name);
|
||||||
|
@ -153,11 +145,19 @@ master_h_template = """//This file is automaically generated. Do not modify it.
|
||||||
#define KIWIX_{BASENAME}
|
#define KIWIX_{BASENAME}
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
namespace RESOURCE {{
|
namespace RESOURCE {{
|
||||||
{RESOURCES}
|
{RESOURCES}
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
class ResourceNotFound : public std::runtime_error {{
|
||||||
|
public:
|
||||||
|
ResourceNotFound(const std::string& what_arg):
|
||||||
|
std::runtime_error(what_arg)
|
||||||
|
{{ }};
|
||||||
|
}};
|
||||||
|
|
||||||
const std::string& getResource_{basename}(const std::string& name);
|
const std::string& getResource_{basename}(const std::string& name);
|
||||||
|
|
||||||
#define getResource(a) (getResource_{basename}(a))
|
#define getResource(a) (getResource_{basename}(a))
|
||||||
|
|
Loading…
Reference in New Issue