diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | include/channels.h | 5 | ||||
| -rw-r--r-- | include/config.h | 23 |
3 files changed, 23 insertions, 11 deletions
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 448e7fdac..763826344 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -6,8 +6,8 @@ set_target_properties(version-bin PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${L set(version_BINARY "$<TARGET_FILE:version-bin>") # Modify version.h from the above executable, with dependencies to version.cpp # and all of the source files in the main build -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version_build - COMMAND ${version_BINARY} ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h + COMMAND version-bin ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h DEPENDS version-bin ${SRC_SRCS} ) # Add version-bin to list of files for CPack to ignore @@ -19,4 +19,4 @@ if(NOT WIN32) endif() # Add a custom target to the above file -add_custom_target(headers DEPENDS version-bin ${CMAKE_CURRENT_BINARY_DIR}/version_build) +add_custom_target(headers DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h) diff --git a/include/channels.h b/include/channels.h index e2399b381..da4ab33a4 100644 --- a/include/channels.h +++ b/include/channels.h @@ -288,6 +288,11 @@ class CoreExport Channel : public Base, public Extensible */ bool CheckKick(User *user); + /** Find which bot should send mode/topic/etc changes for this channel + * @return The bot + */ + BotInfo *WhoSends() const; + /** Finds a channel * @param name The channel to find * @return The channel, if found diff --git a/include/config.h b/include/config.h index 0cf9fe52d..bcd792adb 100644 --- a/include/config.h +++ b/include/config.h @@ -19,9 +19,11 @@ namespace Configuration { + namespace Internal + { class CoreExport Block { - friend struct Conf; + friend struct Configuration::Conf; public: typedef Anope::map<Anope::string> item_map; @@ -33,13 +35,17 @@ namespace Configuration block_map blocks; int linenum; + /* Represents a missing tag. */ + static Block EmptyBlock; + public: Block(const Anope::string &); const Anope::string &GetName() const; - int CountBlock(const Anope::string &name); - Block* GetBlock(const Anope::string &name, int num = 0); + int CountBlock(const Anope::string &name) const; + const Block* GetBlock(const Anope::string &name, int num = 0) const; + Block* GetMutableBlock(const Anope::string &name, int num = 0); - template<typename T> inline T Get(const Anope::string &tag) + template<typename T> inline T Get(const Anope::string &tag) const { return this->Get<T>(tag, ""); } @@ -65,6 +71,10 @@ namespace Configuration template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string& def) const; template<> CoreExport time_t Block::Get(const Anope::string &tag, const Anope::string &def) const; template<> CoreExport bool Block::Get(const Anope::string &tag, const Anope::string &def) const; + } // namespace Internal + + typedef const Internal::Block Block; + typedef Internal::Block MutableBlock; /** Represents a configuration file */ @@ -128,9 +138,6 @@ namespace Configuration std::map<Anope::string, Block *> modules; Anope::map<Anope::string> bots; - /* Represents a missing tag. */ - Block EmptyBlock; - Conf(); ~Conf(); @@ -142,7 +149,7 @@ namespace Configuration BotInfo *GetClient(const Anope::string &name); - Block *GetCommand(CommandSource &); + const Block *GetCommand(CommandSource &); }; struct Uplink |
