#include <linkBuilder.h>
Inheritance diagram for jobc::linkBuilder:

Public Member Functions | |
| linkBuilder (const char *tag) | |
| void | Build (const xmli::AttributeList &attr, const std::string &buffer) |
|
|
Definition at line 22 of file linkBuilder.cxx. 00022 : xmli::Builder(tag) { }
|
|
||||||||||||
|
Builders must implement this method which constructs a C++ object from XML attributes
<beetle name="ringo" instrument="drums">
Ringo is my favorite
</beetle>
is passed as two attributes name=ringo, and instrument=drums and with buffer='Ringo is my favorite'Once C++ object is created, it should be placed on a xmli::Stack to be used by other pieces of code
Implements xmli::Builder. Definition at line 26 of file linkBuilder.cxx. References xmli::ChString::Split(). 00028 {
00029 //======================================================================
00030 // Handle the link tag.
00031 //
00032 // At the end of the tag, parse each of the files listed in "buffer"
00033 //======================================================================
00034
00035 // Split the string in to sub fields and extra the values from each
00036 // sub-field
00037 std::vector<std::string> files;
00038 xmli::ChString::Split(buffer.c_str()," ,\n\t\r",files);
00039
00040 // Parse each file
00041 bool iexit = false;
00042 int ierr = 0;
00043 std::vector<std::string>::iterator itr(files.begin());
00044 std::vector<std::string>::iterator itrEnd(files.end());
00045 for (; itr!=itrEnd; ++itr) {
00046 std::string lib = "lib"; lib += *itr; lib += ".so";
00047 ierr += gSystem->Load(lib.c_str());
00048 // if (ierr>=0) std::cout << "JCXML: Linked " << lib << std::endl;
00049 if (ierr<0) {
00050 std::cerr << "jobc/xml: Failed to link " << lib << std::endl;
00051 iexit = true;
00052 }
00053 }
00054 // Do not continue with jobs that failed to link
00055 if (iexit == true) {
00056 std::cerr << "Failed to link libraries." << std::endl;
00057 exit(1);
00058 }
00059 }
|
1.3.9.1