# a_codsection.h

Go to the documentation of this file.

    00001 ///
    00002 /// \file       a_codsection.h
    00003 ///             COD structure for the ALX file parser
    00004 ///
    00005
    00006 /*
    00007     Copyright (C) 2010, Nicolas VIVIEN
    00008     Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/)
    00009
    00010     This program is free software; you can redistribute it and/or modify
    00011     it under the terms of the GNU General Public License as published by
    00012     the Free Software Foundation; either version 2 of the License, or
    00013     (at your option) any later version.
    00014
    00015     This program is distributed in the hope that it will be useful,
    00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    00018
    00019     See the GNU General Public License in the COPYING file at the
    00020     root directory of this project for more details.
    00021 */
    00022
    00023 #ifndef __BARRY_A_CODSECTION_H__
    00024 #define __BARRY_A_CODSECTION_H__
    00025
    00026 #include <vector>
    00027
    00028 #include "dll.h"
    00029 #include "a_common.h"
    00030
    00031
    00032 namespace Barry {
    00033
    00034 namespace ALX {
    00035
    00036
    00037 class BXEXPORT CODSection
    00038 {
    00039 protected:
    00040         std::string id;
    00041         std::string name;
    00042         std::string description;
    00043         std::string version;
    00044         std::string vendor;
    00045         std::string copyright;
    00046         std::string directory;
    00047
    00048         bool isRequired;
    00049         std::vector<std::string> codfiles;
    00050
    00051 public:
    00052         CODSection(void);
    00053         CODSection(const xmlpp::SaxParser::AttributeList& attrs);
    00054         virtual ~CODSection(void);
    00055
    00056         virtual void Dump(std::ostream &os) const = 0;
    00057
    00058         virtual void SetID(const std::string& id);
    00059         virtual void SetName(const std::string& name);
    00060         virtual void SetDescription(const std::string& description);
    00061         virtual void SetVersion(const std::string& version);
    00062         virtual void SetVendor(const std::string& vendor);
    00063         virtual void SetCopyright(const std::string& copyright);
    00064         virtual void SetDirectory(const std::string& directory);
    00065         virtual void SetRequired(const std::string& required);
    00066         virtual void AddFiles(const std::string& files);
    00067         virtual void AddFile(const std::string& files);
    00068 };
    00069
    00070
    00071 inline std::ostream& operator<<(std::ostream& os, const CODSection& cod)
    00072 {
    00073         cod.Dump(os);
    00074         return os;
    00075 }
    00076
    00077
    00078 } // namespace ALX
    00079
    00080 } // namespace Barry
    00081
    00082 #endif
    00083
    00084