ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/GoogleTron/Command.cpp
Revision: 716
Committed: 2006-03-28T04:49:27-08:00 (19 years, 2 months ago) by douglas
File size: 943 byte(s)
Log Message:
Checkpoint Charlie!

File Contents

# Content
1 // Command
2 //
3 // Douglas Thrift
4 //
5 // $Id$
6
7 #include <cxx/standard.hh>
8
9 #include <api/files.hpp>
10
11 #include "Command.hpp"
12
13 template <typename Type>
14 Type CommandRunner::GetProperties(const cse::String &property, const cse::String &target)
15 {
16 Type properties;
17 _S<ios::Buffer> buffer(client.GetProperty(property, target));
18 ext::Buffer property_;
19
20 while (ios::ReadLine(buffer, property_))
21 properties.Insert(property_);
22
23 return properties;
24 }
25
26 template ext::RedBlackSet<cse::String> CommandRunner::GetProperties(const cse::String &properties, const cse::String &target);
27
28 cse::String CommandRunner::GetPassword(const api::Path &directory)
29 {
30 api::Path path(directory.GetChild(_B(".GoogleTron.Password")));
31 cse::String password;
32
33 if (path.Exists())
34 try
35 {
36 _S<api::FileReader> reader(path.GetPath());
37
38 password = ios::ReadLine(reader);
39 }
40 catch (ext::EosException) {}
41 else
42 password = ::getpass("Password:");
43
44 return password;
45 }

Properties

Name Value
svn:eol-style native
svn:keywords Id