Merge pull request #90 from kiwix/fix_resource_script

[resource_compiler] Make the exception public.
This commit is contained in:
Matthieu Gautier 2017-10-10 14:17:44 +02:00 committed by GitHub
commit 41e3707f1b
1 changed files with 8 additions and 8 deletions

View File

@ -106,16 +106,8 @@ master_c_template = """//This file is automaically generated. Do not modify it.
#include <stdlib.h>
#include <fstream>
#include <stdexcept>
#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)
{{
char * resPath = getenv(name);
@ -153,11 +145,19 @@ master_h_template = """//This file is automaically generated. Do not modify it.
#define KIWIX_{BASENAME}
#include <string>
#include <stdexcept>
namespace RESOURCE {{
{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);
#define getResource(a) (getResource_{basename}(a))