LicenseSpring C++ SDK
Easily add Software Licensing to your application
CustomField.h
Go to the documentation of this file.
1#ifndef LS_CUSTOM_FIELD_H
2#define LS_CUSTOM_FIELD_H
3
4#ifdef _MSC_VER
5#pragma once
6#pragma warning(push)
7#pragma warning(disable : 4251)
8#endif
9
10#include <string>
11#include "APIDef.h"
12
13namespace LicenseSpring
14{
18{
19public:
21 CustomField() = default;
22
26 CustomField(const std::string &name, const std::string &value) : m_name(name), m_value(value) {}
27
30 const std::string &fieldName() const { return m_name; };
31
34 void setFieldName(const std::string &name) { m_name = name; }
35
38 const std::string &fieldValue() const { return m_value; };
39
42 void setFieldValue(const std::string &value) { m_value = value; }
43
47 bool operator==(const CustomField &other) const
48 {
49 return m_name == other.m_name && m_value == other.m_value;
50 }
51
52private:
53 std::string m_name;
54 std::string m_value;
55};
56} // namespace LicenseSpring
57
58#ifdef _MSC_VER
59#pragma warning(pop)
60#endif
61
62#endif // LS_CUSTOM_FIELD_H
#define LS_API
Definition: APIDef.h:23
Class for storing key-value data field.
Definition: CustomField.h:18
const std::string & fieldValue() const
Getter method for data field value.
Definition: CustomField.h:38
void setFieldValue(const std::string &value)
Setter method for data field value.
Definition: CustomField.h:42
CustomField()=default
Default constructor, creates empty data field.
bool operator==(const CustomField &other) const
Equality operator to compare two CustomField objects.
Definition: CustomField.h:47
void setFieldName(const std::string &name)
Setter method for data field name.
Definition: CustomField.h:34
CustomField(const std::string &name, const std::string &value)
Constructs data field with given name (key) and value.
Definition: CustomField.h:26
const std::string & fieldName() const
Getter method for data field name.
Definition: CustomField.h:30