repositery.h

Go to the documentation of this file.
00001 /* -*- Mode:c++ -*- */
00002 /*
00003  *  this is part of Spm
00004  *
00005  *  Copyright (c) 2008 Guillaume Chevallereau
00006  *
00007  *  This program is free software. You can redistribute it and/or modify it 
00008  *  under the terms of the GNU General Public License as published by the 
00009  *  Free Software Foundation. Either version 2 of the license or (at your 
00010  *  option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be usefull but WITHOUT
00013  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
00014  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
00015  *  more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License along 
00018  *  with this program; if not, write to the Free Software Foundation, Inc., 
00019  *  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
00020  */
00021 #ifndef REPOSITERY_H
00022 #define REPOSITERY_H
00023 
00024 #include <util/object.h>
00025 #include <plugin/infoInterface.h>
00026 #include "action.h"
00027 
00028 namespace Spm
00029 {
00030   namespace Core
00031   {
00032     class RepositeryCache;
00033     class Repositery : public Util::Object
00034     {
00035       friend class RepositeryCache;
00036       miniXml::ustring description_;
00037       miniXml::ustring url_;
00038       miniXml::ustring plugin_;
00039       RepositeryCache * pCache_;
00040       std::vector<Plugin::InfoInterface::element *> elements_;
00041     public:
00042       typedef std::vector<Plugin::InfoInterface::element *>::iterator iterator;
00043       typedef std::vector<Plugin::InfoInterface::element *>::reverse_iterator reverse_iterator;
00044       typedef std::vector<Plugin::InfoInterface::element *>::const_iterator const_iterator;
00045       typedef std::vector<Plugin::InfoInterface::element *>::const_reverse_iterator const_reverse_iterator;
00046       Repositery ();
00047       Repositery (const miniXml::ustring & name,
00048                   const miniXml::ustring & url,
00049                   const miniXml::ustring & plugin);
00050       const miniXml::ustring & name ();
00051       const miniXml::ustring & name () const;
00052       const miniXml::ustring & url ();
00053       const miniXml::ustring & url () const;
00054       const miniXml::ustring & plugin ();
00055       const miniXml::ustring & plugin () const;
00056       void update ();
00057       void search(const miniXml::ustring & str,
00058                   std::vector<Plugin::InfoInterface::element *> & elements);
00059       iterator find (const miniXml::ustring & packageName);
00060 #ifdef REPOSITRY_INSTALL
00061       Action * install(const miniXml::ustring & package,
00062                        const miniXml::ustring & version = "");
00063       Action * install(Plugin::InfoInterface::version * version);
00064 #endif
00065       iterator begin ()
00066       {
00067         return elements_.begin ();
00068       }
00069 
00070       iterator end ()
00071       {
00072         return elements_.end ();
00073       }
00074 
00075       const_iterator begin () const
00076       {
00077         return elements_.begin ();
00078       }
00079 
00080       const_iterator end () const
00081       {
00082         return elements_.end ();
00083       }
00084 
00085       reverse_iterator rbegin ()
00086       {
00087         return elements_.rbegin ();
00088       }
00089 
00090       reverse_iterator rend ()
00091       {
00092         return elements_.rend ();
00093       }
00094 
00095       const_reverse_iterator rbegin () const
00096       {
00097         return elements_.rbegin ();
00098       }
00099 
00100       const_reverse_iterator rend () const
00101       {
00102         return elements_.rend ();
00103       }
00104 
00105       std::size_t size ()
00106       {
00107         return elements_.size ();
00108       }
00109     };
00110   }
00111 }
00112 #endif

Generated on Sat Mar 21 17:00:14 2009 for libSpm by  doxygen 1.5.2