Added basic QRCode class and enums for method and correction level
This commit is contained in:
parent
62735ec40c
commit
9f77df06df
8
QRCodeLibrary/QRCode.cpp
Normal file
8
QRCodeLibrary/QRCode.cpp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#include "pch.h"
|
||||||
|
#include "QRCode.hpp"
|
||||||
|
|
||||||
|
QRCode::QRCode(string input_, CorrectionLevel corr_lvl_, QRCodeMethod method_, unsigned char version_):
|
||||||
|
input{ input_ }, corr_lvl{ corr_lvl_ }, method{ method_ }, version{ version_ }
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
20
QRCodeLibrary/QRCode.hpp
Normal file
20
QRCodeLibrary/QRCode.hpp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "method.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
class QRCode
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QRCode(string input_, CorrectionLevel corr_lvl_ = CorrectionLevel::Q, QRCodeMethod method_ = QRCodeMethod::Dynamic, unsigned char version_ = 0);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
string input;
|
||||||
|
CorrectionLevel corr_lvl;
|
||||||
|
QRCodeMethod method;
|
||||||
|
unsigned char version;
|
||||||
|
};
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
// QRCodeLibrary.cpp : Defines the functions for the static library.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "pch.h"
|
|
||||||
#include "framework.h"
|
|
||||||
|
|
||||||
// TODO: This is an example of a library function
|
|
||||||
void fnQRCodeLibrary()
|
|
||||||
{
|
|
||||||
}
|
|
@ -152,7 +152,9 @@
|
|||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="framework.h" />
|
<ClInclude Include="framework.h" />
|
||||||
|
<ClInclude Include="method.hpp" />
|
||||||
<ClInclude Include="pch.h" />
|
<ClInclude Include="pch.h" />
|
||||||
|
<ClInclude Include="QRCode.hpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="pch.cpp">
|
<ClCompile Include="pch.cpp">
|
||||||
@ -161,7 +163,7 @@
|
|||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="QRCodeLibrary.cpp" />
|
<ClCompile Include="QRCode.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
@ -21,12 +21,18 @@
|
|||||||
<ClInclude Include="pch.h">
|
<ClInclude Include="pch.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="QRCode.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="method.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="QRCodeLibrary.cpp">
|
<ClCompile Include="pch.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="pch.cpp">
|
<ClCompile Include="QRCode.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
19
QRCodeLibrary/method.hpp
Normal file
19
QRCodeLibrary/method.hpp
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
enum class QRCodeMethod {
|
||||||
|
Dynamic,
|
||||||
|
Numeric,
|
||||||
|
Alphabetic,
|
||||||
|
Byte
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class CorrectionLevel {
|
||||||
|
L,
|
||||||
|
M,
|
||||||
|
Q,
|
||||||
|
H
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user