OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [tools/] [src/] [librtools/] [RparseUrl.hpp] - Blame information for rev 31

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 wfjm
// $Id: RparseUrl.hpp 492 2013-02-24 22:14:47Z mueller $
2
//
3
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
//
5
// This program is free software; you may redistribute and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, either version 2, or at your option any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
// for complete details.
13
// 
14
// Revision History: 
15
// Date         Rev Version  Comment
16
// 2013-02-23   492   1.0.1  add static FindScheme(); allow no or empty scheme
17
// 2013-02-03   481   1.0    Initial version, extracted from RlinkPort
18
// ---------------------------------------------------------------------------
19
 
20
/*!
21
  \file
22
  \version $Id: RparseUrl.hpp 492 2013-02-24 22:14:47Z mueller $
23
  \brief   Declaration of class RparseUrl.
24
*/
25
 
26
#ifndef included_Retro_RparseUrl
27
#define included_Retro_RparseUrl 1
28
 
29
#include <string>
30
#include <map>
31
 
32
#include "RerrMsg.hpp"
33
 
34
namespace Retro {
35
 
36
  class RparseUrl {
37
    public:
38
      typedef std::map<std::string, std::string> omap_t;
39
      typedef omap_t::iterator         omap_it_t;
40
      typedef omap_t::const_iterator   omap_cit_t;
41
      typedef omap_t::value_type       omap_val_t;
42
 
43
                    RparseUrl();
44
      virtual      ~RparseUrl();
45
 
46
      bool          Set(const std::string& url, const std::string& optlist,
47
                        RerrMsg& emsg);
48
      void          SetPath(const std::string& path);
49
 
50
      void          Clear();
51
 
52
      const std::string&  Url() const;
53
      const std::string&  Scheme() const;
54
      const std::string&  Path() const;
55
      const omap_t&       Opts() const;
56
      bool                FindOpt(const std::string& name) const;
57
      bool                FindOpt(const std::string& name,
58
                                  std::string& value) const;
59
 
60
      virtual void  Dump(std::ostream& os, int ind=0, const char* text=0) const;
61
 
62
      static std::string  FindScheme(const std::string& url,
63
                                     const std::string& def = "");
64
 
65
    protected:
66
      bool          AddOpt(const std::string& key, const std::string& val,
67
                           bool hasval, const std::string& optlist,
68
                           RerrMsg& emsg);
69
 
70
    protected:
71
      std::string   fUrl;                   //!< full url given with open
72
      std::string   fScheme;                //!< url scheme part
73
      std::string   fPath;                  //!< url path part
74
      omap_t        fOptMap;                //!< option map
75
  };
76
 
77
} // end namespace Retro
78
 
79
#include "RparseUrl.ipp"
80
 
81
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.