Back to index

nordugrid-arc-nox  1.1.0~rc6
Source.h
Go to the documentation of this file.
00001 #ifndef __ARC_SEC_SOURCE_H__
00002 #define __ARC_SEC_SOURCE_H__
00003 
00004 #include <fstream>
00005 #include <arc/XMLNode.h>
00006 #include <arc/URL.h>
00007 
00008 namespace ArcSec {
00009 
00011 
00013 class Source {
00014  private:
00015   Arc::XMLNode node;
00016   Source(void) { };
00017  public:
00019 
00022   Source(const Source& s):node(s.node) { };
00024   Source(Arc::XMLNode& xml);
00026   Source(std::istream& stream);
00028 
00029   Source(Arc::URL& url);
00031   Source(const std::string& str);
00033   Arc::XMLNode Get(void) const { return node; };
00035   operator bool(void) { return (bool)node; };
00036   operator Arc::XMLNode(void) { return node; };
00037 };
00038 
00040 class SourceFile: public Source {
00041  private:
00042   std::ifstream* stream;
00043   SourceFile(void):Source("") {};
00044  public:
00046   SourceFile(const SourceFile& s):Source(s),stream(NULL) {};
00048   SourceFile(const char* name);
00050   SourceFile(const std::string& name);
00051   ~SourceFile(void);
00052 };
00053 
00055 class SourceURL: public Source {
00056  private:
00057   Arc::URL* url;
00058   SourceURL(void):Source("") {};
00059  public:
00061   SourceURL(const SourceURL& s):Source(s),url(NULL) {};
00063   SourceURL(const char* url);
00065   SourceURL(const std::string& url);
00066   ~SourceURL(void);
00067 };
00068 
00069 }
00070 
00071 #endif
00072