forked from adzm/mssqlPipe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparams.h
More file actions
66 lines (50 loc) · 1002 Bytes
/
params.h
File metadata and controls
66 lines (50 loc) · 1002 Bytes
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
#include <string>
#include <iostream>
#include <sstream>
#include "util.h"
struct paramflags
{
bool noelevate = false;
bool test = false;
std::string tee;
};
struct params
{
std::string instance;
std::string command;
std::string subcommand;
std::string database;
std::string device;
std::string from;
std::string to;
std::string as;
std::string username;
std::string password;
HRESULT hr = S_OK;
std::string errorMessage;
paramflags flags;
friend std::ostream& operator<<(std::ostream& o, const params& p);
DWORD timeout = 10 * 1000;
bool isRestore() const
{
return iequals(command, "restore");
}
bool isBackup() const
{
return iequals(command, "backup");
}
bool isBackupOrRestore() const
{
return isBackup() || isRestore();
}
bool isPipe() const
{
return iequals(command, "pipe");
}
};
#ifdef _DEBUG
bool TestParseParams();
#endif
params ParseParams(int argc, const char* argv[], bool quiet);
std::string MakeParams(const params& p);