From 8d2d31514295a2d0eff5971887246f6d4211fc6d Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Thu, 28 Mar 2013 15:51:38 +0100 Subject: Added code to parse properties and to find correct configuration files from c++ part of plugin. --- plugin/icedteanp/IcedTeaPluginUtils.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'plugin/icedteanp/IcedTeaPluginUtils.cc') diff --git a/plugin/icedteanp/IcedTeaPluginUtils.cc b/plugin/icedteanp/IcedTeaPluginUtils.cc index 6e41c19..d365b05 100644 --- a/plugin/icedteanp/IcedTeaPluginUtils.cc +++ b/plugin/icedteanp/IcedTeaPluginUtils.cc @@ -39,6 +39,7 @@ exception statement from your version. */ #include "IcedTeaNPPlugin.h" #include "IcedTeaScriptablePluginObject.h" #include "IcedTeaPluginUtils.h" +#include /** * Misc. utility functions used by the plugin @@ -1068,6 +1069,21 @@ processAsyncCallQueue(void* param /* ignored */) } while(1); } +void IcedTeaPluginUtilities::trim(std::string& str) { + size_t start = str.find_first_not_of(" \t\n"), end = str.find_last_not_of(" \t\n"); + if (start == std::string::npos) { + return; + } + str = str.substr(start, end - start + 1); +} + +bool IcedTeaPluginUtilities::file_exists(std::string filename) +{ + std::ifstream infile(filename.c_str()); + return infile.good(); +} + + /****************************************** * Begin JavaMessageSender implementation * ****************************************** @@ -1203,3 +1219,4 @@ MessageBus::post(const char* message) PLUGIN_DEBUG("%p unlocked...\n", &msg_queue_mutex); } + -- cgit v1.2.3