RCFProto

- Main Page
- Classes
- Files

- File List

All Classes Functions Typedefs
Usernames.hpp
1
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2013, Delta V Software. All rights reserved.
6 // http://www.deltavsoft.com
7 //
8 // RCF is distributed under dual licenses - closed source or GPL.
9 // Consult your particular license for conditions of use.
10 //
11 // If you have not purchased a commercial license, you are using RCF
12 // under GPL terms.
13 //
14 // Version: 2.0
15 // Contact: support <at> deltavsoft.com
16 //
17 //******************************************************************************
18
19 #ifndef INCLUDE_RCF_TEST_USERNAMES_HPP
20 #define INCLUDE_RCF_TEST_USERNAMES_HPP
21
22 #include <fstream>
23 #include <string>
24
25 class Usernames
26 {
27 public:
28 std::string mLocalUsername;
29 std::string mLocalPassword;
30 std::string mLocalPasswordBad;
31 std::string mAdUsername;
32 std::string mAdPassword;
33 std::string mAdPasswordBad;
34 std::string mAdDomain;
35 };
36
37 bool getUsernames(Usernames & usernames)
38 {
39 std::string whichFile = RCF::getRelativeTestDataPath() + "sspi.txt";
40
41 std::ifstream fin(whichFile.c_str());
42
43 if (!fin)
44 {
45 return false;
46 }
47
48 fin >> usernames.mLocalUsername;
49 fin >> usernames.mLocalPassword;
50 fin >> usernames.mLocalPasswordBad;
51 fin >> usernames.mAdUsername;
52 fin >> usernames.mAdPassword;
53 fin >> usernames.mAdPasswordBad;
54 fin >> usernames.mAdDomain;
55
56 assert(fin);
57
58 if (!fin)
59 {
60 return false;
61 }
62
63 fin.close();
64
65 return true;
66 }
67
68 #endif // ! INCLUDE_RCF_TEST_USERNAMES_HPP