forked from aegoroff/parser3mssql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConnectionString.h
More file actions
73 lines (63 loc) · 2.27 KB
/
ConnectionString.h
File metadata and controls
73 lines (63 loc) · 2.27 KB
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
67
68
69
70
71
72
73
/*!
* \brief The file contains connection string wrapper interface
* \author \verbatim
Created by: Alexander Egorov
\endverbatim
* \date \verbatim
Creation date: 2010-04-11
\endverbatim
* Copyright 2008-2012 Alexander Egorov <egoroff@gmail.com> (http://www.egoroff.spb.ru)
*/
#pragma once
/**
* \brief Represents connection string wrapper class
*/
class ConnectionString {
public:
/**
* \brief Creates new wrapper instance using raw string specified
* @param pRawString Raw string to wrap up
*/
explicit ConnectionString(__in const char* pRawString);
/**
* \brief Virtual descructor
*/
virtual ~ConnectionString(void);
/**
* \brief Parses raw string
*/
void Parse();
/**
* \brief Shows whether connection string contains charset parameter (backward compatibility only)
* \return True in connection string contains charset parameter otherwise false
*/
__checkReturn bool ContainsCharset() const;
/**
* \brief Gets charset parameter value (backward compatibility only)
* \return charset parameter value
*/
const std::string& GetCharset() const;
/**
* \brief Copies charset into buffer specified (backward compatibility only)
* @param pDestination Destination buffer
* @param destLength Destination buffer length
*/
void CopyCharset(
__out char* pDestination, std::string::size_type destLength) const;
/**
* \brief Gets charset parameter value length (backward compatibility only)
* \return charset parameter value length
*/
__checkReturn size_t CharsetLength() const;
/**
* \brief Gets pure OLE DB compatible string (without any additional parser's options)
* \return OLE DB compatible string
*/
const std::string& GetOleDBString() const;
private:
std::string charset_;
std::string cnString_;
std::string oleDBString_;
bool containsCharset_;
DISALLOW_COPY_AND_ASSIGN(ConnectionString);
};