summaryrefslogtreecommitdiff
path: root/DAnCE/tools/Artifact_Installation/DAnCE_Artifact_Installation_Handler.inl
blob: 5cf378656aac78246e6192975f3c230df64d1709 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// -*- C++ -*-
namespace DAnCE
{
  ACE_INLINE
  std::string ArtifactInstallationHandler::basename (const std::string& location, char dirsep)
  {
    std::string::size_type n = location.rfind (dirsep);
    return (n == std::string::npos) ? location : location.substr (n+1);
  }

  ACE_INLINE
  bool ArtifactInstallationProperties::has_property (const std::string& propname)
    {
      TPropertyMap::const_iterator it = this->propmap_.find (PROPERTY_BASE+propname);
      if (it == this->propmap_.end () && !this->protocol_.empty ())
        {
          it = this->propmap_.find (PROPERTY_BASE+this->protocol_+propname);
        }
      return it != this->propmap_.end ();
    }

  ACE_INLINE
  const std::string& ArtifactInstallationProperties::get_property (const std::string& propname)
    {
      TPropertyMap::const_iterator it = this->propmap_.find (PROPERTY_BASE+propname);
      if (it == this->propmap_.end () && !this->protocol_.empty ())
        {
          it = this->propmap_.find (PROPERTY_BASE+this->protocol_+propname);
        }
      if (it != this->propmap_.end ())
          return it->second;
      else
        return empty_;
    }
}