DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
DbParameter.h
Go to the documentation of this file.
1#pragma once
2#include "Common.h"
3#include "System/Object.h"
4#include "System/String.h"
5#include "System/Convert.h"
7
8namespace DotNetDupe {
9 namespace System {
10 namespace Data {
11 namespace Common {
12
18 class DbParameter : public virtual DotNetDupe::System::Object {
19 private:
20 DotNetDupe::System::String m_sParameterName;
22
23 public:
25 DbParameter() = default;
26
31 : m_sParameterName(sName), m_sValue(sValue) {}
32
34 ~DbParameter() override = default;
35
38 DotNetDupe::System::String GetParameterName() const { return m_sParameterName; }
39
42 void SetParameterName(const DotNetDupe::System::String& sName) { m_sParameterName = sName; }
43
46 DotNetDupe::System::String GetValue() const { return m_sValue; }
47
50 void SetValue(const DotNetDupe::System::String& sValue) { m_sValue = sValue; }
51 };
52
59 private:
61
62 public:
65
67 ~DbParameterCollection() override = default;
68
71 int GetCount() const { return m_parameters.GetCount(); }
72
76 m_parameters.Add(pParameter);
77 }
78
83 m_parameters.Add(DotNetDupe::System::SmartPointer<DbParameter>::NewShared(sName, sValue));
84 }
85
92
99
104 return m_parameters[index];
105 }
106
108 void Clear() {
109 m_parameters.Clear();
110 }
111 };
112
113 }
114 }
115 }
116}
Defines common cross-platform macros, export decorators, and fundamental types.
Converts a base data type to another base data type, and encodes/decodes Base64 data.
Represents a strongly typed list of objects that can be accessed by index mirroring ....
Base object class for DotNetDupe mirroring .NET System.Object.
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
Represents a strongly typed list of objects accessible by index.
Definition List.h:29
static String ToString(bool value)
Definition Convert.cpp:253
int GetCount() const
Gets the number of DbParameter objects in the collection.
Definition DbParameter.h:71
void AddWithValue(const DotNetDupe::System::String &sName, int iValue)
Adds a parameter with a specified name and 32-bit integer value.
Definition DbParameter.h:89
void Add(const DotNetDupe::System::SmartPointer< DbParameter > &pParameter)
Adds the specified DbParameter object to the DbParameterCollection.
Definition DbParameter.h:75
void Clear()
Removes all DbParameter objects from the DbParameterCollection.
DotNetDupe::System::SmartPointer< DbParameter > GetAt(int index) const
Gets the DbParameter object at the specified index.
void AddWithValue(const DotNetDupe::System::String &sName, const DotNetDupe::System::String &sValue)
Adds a parameter with a specified name and string value.
Definition DbParameter.h:82
void AddWithValue(const DotNetDupe::System::String &sName, double dValue)
Adds a parameter with a specified name and double value.
Definition DbParameter.h:96
DbParameterCollection()=default
Initializes a new instance of DbParameterCollection.
~DbParameterCollection() override=default
Virtual destructor.
DotNetDupe::System::String GetParameterName() const
Gets the name of the DbParameter.
Definition DbParameter.h:38
DotNetDupe::System::String GetValue() const
Gets the value of the parameter.
Definition DbParameter.h:46
DbParameter()=default
Initializes a new default instance of DbParameter.
DbParameter(const DotNetDupe::System::String &sName, const DotNetDupe::System::String &sValue)
Initializes a new instance of DbParameter with a name and value.
Definition DbParameter.h:30
~DbParameter() override=default
Virtual destructor for polymorphic cleanup.
void SetParameterName(const DotNetDupe::System::String &sName)
Sets the name of the DbParameter.
Definition DbParameter.h:42
void SetValue(const DotNetDupe::System::String &sValue)
Sets the value of the parameter.
Definition DbParameter.h:50
Supports all classes in the DotNetDupe class hierarchy.
Definition Object.h:18
A unified smart pointer that supports both unique and shared ownership semantics.
static SmartPointer< T > NewShared()
Creates a Shared SmartPointer, default constructing T.
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74