llliveappconfig.cpp

Go to the documentation of this file.
00001 
00032 #include "linden_common.h"
00033 
00034 #include "llliveappconfig.h"
00035 
00036 #include "llapp.h"
00037 #include "llsd.h"
00038 #include "llsdserialize.h"
00039 
00040 LLLiveAppConfig::LLLiveAppConfig(LLApp* app, const std::string& filename, F32 refresh_period)
00041 :       LLLiveFile(filename, refresh_period),
00042         mApp(app)
00043 { }
00044 
00045 
00046 LLLiveAppConfig::~LLLiveAppConfig()
00047 { }
00048 
00049 // virtual 
00050 void LLLiveAppConfig::loadFile()
00051 {
00052         llinfos << "LLLiveAppConfig::loadFile(): reading from "
00053                 << filename() << llendl;
00054     llifstream file(filename().c_str());
00055         LLSD config;
00056     if (file.is_open())
00057     {
00058         LLSDSerialize::fromXML(config, file);
00059                 if(!config.isMap())
00060                 {
00061                         llinfos << "LLDataserverConfig::loadFile(): not an map!"
00062                                 << " Ignoring the data." << llendl;
00063                         return;
00064                 }
00065                 file.close();
00066     }
00067         mApp->setOptionData(
00068                 LLApp::PRIORITY_SPECIFIC_CONFIGURATION, config);
00069 }

Generated on Fri May 16 08:32:03 2008 for SecondLife by  doxygen 1.5.5