LicenseSpring C++ SDK 7.31.0
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 {
19 public:
21 CustomField() = default;
22
26 CustomField( const std::string& name, const std::string& value )
27 : m_name( name )
28 , m_value( value )
29 {}
30
33 const std::string& fieldName() const { return m_name; };
34
37 void setFieldName( const std::string& name ) { m_name = name; }
38
41 const std::string& fieldValue() const { return m_value; };
42
45 void setFieldValue( const std::string& value ) { m_value = value; }
46
47 private:
48 std::string m_name;
49 std::string m_value;
50 };
51}
52
53#ifdef _MSC_VER
54#pragma warning( pop )
55#endif
56
57#endif // LS_CUSTOM_FIELD_H
#define LS_API
Macros that expands to dllexport, dllimport or nothing on non Windows platforms or in case of static ...
Definition: APIDef.h:22
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:41
void setFieldValue(const std::string &value)
Setter method for data field value.
Definition: CustomField.h:45
CustomField()=default
Default constructor, creates empty data field.
void setFieldName(const std::string &name)
Setter method for data field name.
Definition: CustomField.h:37
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:33