Back to index

nordugrid-arc-nox  1.1.0~rc6
Source.cpp
Go to the documentation of this file.
00001 #ifdef HAVE_CONFIG_H
00002 #include <config.h>
00003 #endif
00004 #include "Source.h"
00005 
00006 namespace ArcSec {
00007 
00008 Source::Source(Arc::XMLNode& xml):node(xml) {
00009 }
00010 
00011 Source::Source(std::istream& stream) {
00012   node.ReadFromStream(stream);
00013 }
00014 
00015 Source::Source(Arc::URL&) {
00016   //TODO: 
00017 }
00018 
00019 Source::Source(const std::string& str) {
00020   // TODO: Extend XMLNode to do this in one operation
00021   Arc::XMLNode xml(str);
00022   xml.New(node);
00023 }
00024 
00025 SourceFile::SourceFile(const char* name):Source(*(stream = new std::ifstream(name))) {
00026 }
00027 
00028 SourceFile::SourceFile(const std::string& name):Source(*(stream = new std::ifstream(name.c_str()))) {
00029 }
00030 
00031 SourceFile::~SourceFile(void) {
00032   if(stream) delete stream;
00033 }
00034 
00035 SourceURL::SourceURL(const char* source):Source(*(url = new Arc::URL(source))) {
00036 }
00037 
00038 SourceURL::SourceURL(const std::string& source):Source(*(url = new Arc::URL(source))) {
00039 }
00040 
00041 SourceURL::~SourceURL(void) {
00042   if(url) delete url;
00043 }
00044 
00045 
00046 } // namespace ArcSec
00047