コード例 #1
0
 bool filesystem_adaptor::is_absolute (const saga::url & u)
 {
   if ( u.get_scheme   ().empty ()  &&
        u.get_host     ().empty ()  &&
        u.get_username ().empty ()  &&
        u.get_password ().empty ()  &&
        u.get_port     ()    == -1  &&
        u.get_path     ()[0] != '/' )
   {
     return false;
   }
   
   return true;
 }
コード例 #2
0
  std::string filesystem_adaptor::get_sshfs_id (const saga::url & u)
  {
    std::string host = u.get_host     ();
    int         port = u.get_port     ();
    std::string user = u.get_username ();

    std::stringstream ss;

    if ( ! user.empty () )   ss << user << "@" ;
    if ( ! host.empty () )   ss << host;
    if ( port == -1      )   ss << ":"  << 22  ;
    else                     ss << ":"  << port;

    return ss.str ();
  }