Clean up libaegisub includes

Remove cajun includes from all public headers and the precompiled header

Add a pile of missing standard library headers used in multiple files
to lagi_pre

Originally committed to SVN as r5452.
This commit is contained in:
Thomas Goyne 2011-07-15 04:04:34 +00:00
parent 48fbedd25b
commit 6ec63cdde1
13 changed files with 34 additions and 40 deletions

View file

@ -19,10 +19,10 @@
/// @ingroup libaegisub
#ifndef LAGI_PRE
#include <assert.h>
#include <errno.h>
#include <stdint.h>
#include <cassert>
#include <map>
#endif

View file

@ -21,11 +21,11 @@
#ifndef LAGI_PRE
#include <fstream>
#include <time.h>
#endif
#include "libaegisub/cajun/reader.h"
#include "libaegisub/cajun/writer.h"
#include "libaegisub/cajun/elements.h"
#endif
#include "libaegisub/access.h"
#include "libaegisub/log.h"

View file

@ -18,20 +18,23 @@
/// @brief Option interface.
/// @ingroup libaegisub
#include "libaegisub/option.h"
#ifndef LAGI_PRE
#include <fstream>
#include <sstream>
#include <map>
#include <memory>
#endif
#include "libaegisub/cajun/reader.h"
#include "libaegisub/cajun/writer.h"
#include "libaegisub/cajun/elements.h"
#endif
#include "libaegisub/access.h"
#include "libaegisub/io.h"
#include "libaegisub/log.h"
#include "libaegisub/option_value.h"
#include "option_visit.h"

View file

@ -26,21 +26,18 @@
#endif
#include <libaegisub/colour.h>
#include <libaegisub/option_value.h>
#include "option_visit.h"
namespace agi {
ConfigVisitor::ConfigVisitor(OptionValueMap &val, const std::string &member_name): values(val) {
// Corresponding code is in AddOptionValue()
name = member_name + "/";
ConfigVisitor::ConfigVisitor(OptionValueMap &val, const std::string &member_name)
: values(val)
, name(member_name + "/")
{
}
ConfigVisitor::~ConfigVisitor() {
}
void ConfigVisitor::Visit(const json::Object& object) {
json::Object::const_iterator index(object.Begin()), index_end(object.End());
for (; index != index_end; ++index) {

View file

@ -19,14 +19,9 @@
/// @see option_visit.cpp
/// @ingroup libaegisub
#ifndef LAGI_PRE
#include "libaegisub/option.h"
#include "libaegisub/cajun/elements.h"
#include "libaegisub/cajun/visitor.h"
#endif
#pragma once
#include "libaegisub/option.h"
namespace agi {
@ -36,7 +31,6 @@ DEFINE_SIMPLE_EXCEPTION_NOINNER(OptionJsonValueSingle, OptionJsonValueError, "op
DEFINE_SIMPLE_EXCEPTION_NOINNER(OptionJsonValueNull, OptionJsonValueError, "options/value")
class ConfigVisitor : public json::ConstVisitor {
OptionValueMap &values;
std::string name;
typedef std::pair<std::string, OptionValue*> OptionValuePair;
@ -44,9 +38,7 @@ class ConfigVisitor : public json::ConstVisitor {
void AddOptionValue(OptionValue* opt);
public:
ConfigVisitor(OptionValueMap &val, const std::string &member_name);
~ConfigVisitor();
void Visit(const json::Array& array);
void Visit(const json::Object& object);

View file

@ -26,6 +26,7 @@
#include "libaegisub/log.h"
#include "libaegisub/path.h"
#include "libaegisub/option.h"
#include "libaegisub/option_value.h"
namespace agi {

View file

@ -26,8 +26,7 @@
#include <vector>
#endif
#include <libaegisub/cajun/elements.h>
namespace json { class Object; }
namespace agi {
namespace hotkey {
@ -125,7 +124,7 @@ private:
/// Build hotkey map.
/// @param context Context being parsed.
/// @param object json::Object holding items for context being parsed.
void BuildHotkey(std::string context, const ::json::Object& object);
void BuildHotkey(std::string context, const json::Object& object);
/// Insert Combo into HotkeyMap instance.
/// @param combo Combo to insert.

View file

@ -18,7 +18,6 @@
/// @brief Parse JSON files and return json::UnknownElement
/// @ingroup libaegisub io
#include <libaegisub/cajun/reader.h>
#include <libaegisub/cajun/elements.h>

View file

@ -18,13 +18,13 @@
/// @brief Public interface for option values.
/// @ingroup libaegisub
#pragma once
#ifndef LAGI_PRE
#include <fstream>
#endif
#include <libaegisub/exception.h>
#include <libaegisub/option_value.h>
namespace json {
class Object;
@ -37,6 +37,7 @@ DEFINE_BASE_EXCEPTION_NOINNER(OptionError,Exception)
DEFINE_SIMPLE_EXCEPTION_NOINNER(OptionErrorNotFound, OptionError, "options/not_found")
DEFINE_SIMPLE_EXCEPTION_NOINNER(OptionErrorDuplicateKey, OptionError, "options/dump/duplicate")
class OptionValue;
/// This is a cool trick: make a class un-copyable, in this case we always want
/// to update our *original* map, this will ensure that it is always updated in

View file

@ -3,12 +3,13 @@
#include "config.h"
// Common C
#include <errno.h>
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <cassert>
#include <cerrno>
#include <cmath>
#include <cstdarg>
#include <cstdio>
#include <cstring>
#include <stdint.h>
#include <string.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
@ -30,16 +31,21 @@
#endif
// Common C++
#include <algorithm>
#include <deque>
#include <climits>
#include <fstream>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <locale>
#include <numeric>
#include <map>
#include <numeric>
#include <sstream>
#include <string>
#include <vector>
#ifdef _WIN32
#include <functional>
@ -56,10 +62,3 @@
#else
# include <strstream>
#endif
// Cajun
#include "libaegisub/cajun/elements.h"
#include "libaegisub/cajun/reader.h"
#include "libaegisub/cajun/visitor.h"
#include "libaegisub/cajun/writer.h"

View file

@ -24,9 +24,10 @@
#include <wx/menu.h>
#endif
#include <libaegisub/cajun/elements.h>
#include <libaegisub/exception.h>
namespace json { class Array; }
namespace menu {
DEFINE_BASE_EXCEPTION_NOINNER(MenuError, agi::Exception)
DEFINE_SIMPLE_EXCEPTION_NOINNER(MenuJsonValueArray, MenuError, "menu/value/array")

View file

@ -24,9 +24,10 @@
#include <wx/toolbar.h>
#endif
#include <libaegisub/cajun/elements.h>
#include <libaegisub/exception.h>
namespace json { class Array; }
namespace toolbar {
DEFINE_BASE_EXCEPTION_NOINNER(ToolbarError, agi::Exception)
DEFINE_SIMPLE_EXCEPTION_NOINNER(ToolbarJsonValueArray, ToolbarError, "toolbar/value/array")

View file

@ -46,6 +46,7 @@
#include "aegisublocale.h"
#include <libaegisub/mru.h>
#include <libaegisub/option.h>
#include <libaegisub/option_value.h>
#include <libaegisub/path.h>
//////////////