\hypertarget{GpgConstants_8h_source}{}\doxysection{Gpg\+Constants.\+h}
\label{GpgConstants_8h_source}\index{src/core/GpgConstants.h@{src/core/GpgConstants.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{29 \textcolor{preprocessor}{\#ifndef GPG\_CONSTANTS\_H}}
\DoxyCodeLine{30 \textcolor{preprocessor}{\#define GPG\_CONSTANTS\_H}}
\DoxyCodeLine{31 }
\DoxyCodeLine{32 \textcolor{preprocessor}{\#include <GpgFrontend.h>}}
\DoxyCodeLine{33 \textcolor{preprocessor}{\#include <gpgme.h>}}
\DoxyCodeLine{34 }
\DoxyCodeLine{35 \textcolor{preprocessor}{\#include <cassert>}}
\DoxyCodeLine{36 \textcolor{preprocessor}{\#include <functional>}}
\DoxyCodeLine{37 }
\DoxyCodeLine{38 \textcolor{comment}{// dll export macro}}
\DoxyCodeLine{39 \textcolor{preprocessor}{\#include "{}GpgFrontendCoreExport.h"{}}}
\DoxyCodeLine{40 }
\DoxyCodeLine{41 \textcolor{keyword}{const} \textcolor{keywordtype}{int} RESTART\_CODE = 1000;  }
\DoxyCodeLine{42 }
\DoxyCodeLine{43 \textcolor{keyword}{namespace }\mbox{\hyperlink{namespaceGpgFrontend}{GpgFrontend}} \{}
\DoxyCodeLine{44 }
\DoxyCodeLine{45 \textcolor{keyword}{using} ByteArray = std::string;                                    }
\DoxyCodeLine{46 \textcolor{keyword}{using} ByteArrayPtr = std::unique\_ptr<ByteArray>;                  }
\DoxyCodeLine{47 \textcolor{keyword}{using} StdBypeArrayPtr = std::unique\_ptr<ByteArray>;               }
\DoxyCodeLine{48 \textcolor{keyword}{using} BypeArrayRef = ByteArray\&;                                  }
\DoxyCodeLine{49 \textcolor{keyword}{using} BypeArrayConstRef = \textcolor{keyword}{const} ByteArray\&;                       }
\DoxyCodeLine{50 \textcolor{keyword}{using} StringArgsPtr = std::unique\_ptr<std::vector<std::string>>;  }
\DoxyCodeLine{51 \textcolor{keyword}{using} StringArgsRef = std::vector<std::string>\&;                  }
\DoxyCodeLine{52 }
\DoxyCodeLine{53 \textcolor{keyword}{using} GpgError = gpgme\_error\_t;}
\DoxyCodeLine{54 }
\DoxyCodeLine{59 \textcolor{keyword}{struct }\mbox{\hyperlink{structGpgFrontend_1_1__result__ref__deletor}{\_result\_ref\_deletor}} \{}
\DoxyCodeLine{60   \textcolor{keywordtype}{void} operator()(\textcolor{keywordtype}{void}* \_result);}
\DoxyCodeLine{61 \};}
\DoxyCodeLine{62 }
\DoxyCodeLine{63 \textcolor{keyword}{using} GpgEncrResult = std::shared\_ptr<struct \_gpgme\_op\_encrypt\_result>;   }
\DoxyCodeLine{64 \textcolor{keyword}{using} GpgDecrResult = std::shared\_ptr<struct \_gpgme\_op\_decrypt\_result>;   }
\DoxyCodeLine{65 \textcolor{keyword}{using} GpgSignResult = std::shared\_ptr<struct \_gpgme\_op\_sign\_result>;      }
\DoxyCodeLine{66 \textcolor{keyword}{using} GpgVerifyResult = std::shared\_ptr<struct \_gpgme\_op\_verify\_result>;  }
\DoxyCodeLine{67 \textcolor{keyword}{using} GpgGenKeyResult = std::shared\_ptr<struct \_gpgme\_op\_genkey\_result>;  }
\DoxyCodeLine{68 }
\DoxyCodeLine{69 \textcolor{comment}{// Convert from  gpgme\_xxx\_result to GpgXXXResult}}
\DoxyCodeLine{70 }
\DoxyCodeLine{77 GPGFRONTEND\_CORE\_EXPORT GpgEncrResult}
\DoxyCodeLine{78 \mbox{\hyperlink{namespaceGpgFrontend_a2a6566f59b4be29e453a1edd93f6a337}{\_new\_result}}(gpgme\_encrypt\_result\_t\&\& result);}
\DoxyCodeLine{79 }
\DoxyCodeLine{86 GPGFRONTEND\_CORE\_EXPORT GpgDecrResult}
\DoxyCodeLine{87 \mbox{\hyperlink{namespaceGpgFrontend_a2a6566f59b4be29e453a1edd93f6a337}{\_new\_result}}(gpgme\_decrypt\_result\_t\&\& result);}
\DoxyCodeLine{88 }
\DoxyCodeLine{95 GPGFRONTEND\_CORE\_EXPORT GpgSignResult \mbox{\hyperlink{namespaceGpgFrontend_a2a6566f59b4be29e453a1edd93f6a337}{\_new\_result}}(gpgme\_sign\_result\_t\&\& result);}
\DoxyCodeLine{96 }
\DoxyCodeLine{103 GPGFRONTEND\_CORE\_EXPORT GpgVerifyResult}
\DoxyCodeLine{104 \mbox{\hyperlink{namespaceGpgFrontend_a2a6566f59b4be29e453a1edd93f6a337}{\_new\_result}}(gpgme\_verify\_result\_t\&\& result);}
\DoxyCodeLine{105 }
\DoxyCodeLine{112 GPGFRONTEND\_CORE\_EXPORT GpgGenKeyResult}
\DoxyCodeLine{113 \mbox{\hyperlink{namespaceGpgFrontend_a2a6566f59b4be29e453a1edd93f6a337}{\_new\_result}}(gpgme\_genkey\_result\_t\&\& result);}
\DoxyCodeLine{114 }
\DoxyCodeLine{115 \textcolor{comment}{// Error Info Printer}}
\DoxyCodeLine{116 }
\DoxyCodeLine{123 GPGFRONTEND\_CORE\_EXPORT GpgError \mbox{\hyperlink{namespaceGpgFrontend_afdad4e5f4c3ac891c09216e245c0f48e}{check\_gpg\_error}}(GpgError err);}
\DoxyCodeLine{124 }
\DoxyCodeLine{132 GPGFRONTEND\_CORE\_EXPORT GpgError \mbox{\hyperlink{namespaceGpgFrontend_afdad4e5f4c3ac891c09216e245c0f48e}{check\_gpg\_error}}(GpgError gpgmeError,}
\DoxyCodeLine{133                                                  \textcolor{keyword}{const} std::string\& comment);}
\DoxyCodeLine{134 }
\DoxyCodeLine{142 GPGFRONTEND\_CORE\_EXPORT gpg\_err\_code\_t \mbox{\hyperlink{namespaceGpgFrontend_a4edac6df92596ba8eea3a8cdc1173684}{check\_gpg\_error\_2\_err\_code}}(}
\DoxyCodeLine{143     gpgme\_error\_t err, gpgme\_error\_t predict = GPG\_ERR\_NO\_ERROR);}
\DoxyCodeLine{144 }
\DoxyCodeLine{145 \textcolor{comment}{// Fingerprint}}
\DoxyCodeLine{146 }
\DoxyCodeLine{153 GPGFRONTEND\_CORE\_EXPORT std::string \mbox{\hyperlink{namespaceGpgFrontend_ac494a4b0d91e08a70db77a399c9a0f30}{beautify\_fingerprint}}(}
\DoxyCodeLine{154     BypeArrayConstRef fingerprint);}
\DoxyCodeLine{155 }
\DoxyCodeLine{156 \textcolor{comment}{// File Operation}}
\DoxyCodeLine{157 }
\DoxyCodeLine{164 std::string \mbox{\hyperlink{namespaceGpgFrontend_a73f3e2217fb1d72dc75f266e11875f6d}{read\_all\_data\_in\_file}}(\textcolor{keyword}{const} std::string\& path);}
\DoxyCodeLine{165 }
\DoxyCodeLine{174 GPGFRONTEND\_CORE\_EXPORT \textcolor{keywordtype}{bool} \mbox{\hyperlink{namespaceGpgFrontend_a5135069571678eda9c1f07d17ed9ac41}{write\_buffer\_to\_file}}(}
\DoxyCodeLine{175     \textcolor{keyword}{const} std::string\& path, \textcolor{keyword}{const} std::string\& out\_buffer);}
\DoxyCodeLine{176 }
\DoxyCodeLine{183 std::string \mbox{\hyperlink{namespaceGpgFrontend_acff2cf5dd5b112b324fa6574ee935f79}{get\_file\_extension}}(\textcolor{keyword}{const} std::string\& path);}
\DoxyCodeLine{184 }
\DoxyCodeLine{191 std::string \mbox{\hyperlink{namespaceGpgFrontend_a5a2f5fc1ad3de55e41a1b7a388821328}{get\_only\_file\_name\_with\_path}}(\textcolor{keyword}{const} std::string\& path);}
\DoxyCodeLine{192 }
\DoxyCodeLine{193 \textcolor{comment}{// Check}}
\DoxyCodeLine{194 }
\DoxyCodeLine{201 \textcolor{keywordtype}{int} \mbox{\hyperlink{namespaceGpgFrontend_a2a0394c8bdd277f5235f9875a1d69a99}{text\_is\_signed}}(BypeArrayRef text);}
\DoxyCodeLine{202 }
\DoxyCodeLine{203 \textcolor{comment}{// Channels}}
\DoxyCodeLine{204 \textcolor{keyword}{const} \textcolor{keywordtype}{int} GPGFRONTEND\_DEFAULT\_CHANNEL = 0;    }
\DoxyCodeLine{205 \textcolor{keyword}{const} \textcolor{keywordtype}{int} GPGFRONTEND\_NON\_ASCII\_CHANNEL = 2;  }
\DoxyCodeLine{206 }
\DoxyCodeLine{211 \textcolor{keyword}{class }GPGFRONTEND\_CORE\_EXPORT \mbox{\hyperlink{classGpgFrontend_1_1GpgConstants}{GpgConstants}} \{}
\DoxyCodeLine{212  \textcolor{keyword}{public}:}
\DoxyCodeLine{213   \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char}* \mbox{\hyperlink{classGpgFrontend_1_1GpgConstants_a237006d6db30c7e3f8de171210eb35f2}{PGP\_CRYPT\_BEGIN}};                 }
\DoxyCodeLine{214   \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char}* PGP\_CRYPT\_END;                   }
\DoxyCodeLine{215   \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char}* PGP\_SIGNED\_BEGIN;                }
\DoxyCodeLine{216   \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char}* PGP\_SIGNED\_END;                  }
\DoxyCodeLine{217   \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char}* PGP\_SIGNATURE\_BEGIN;             }
\DoxyCodeLine{218   \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char}* PGP\_SIGNATURE\_END;               }
\DoxyCodeLine{219   \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char}* PGP\_PUBLIC\_KEY\_BEGIN;            }
\DoxyCodeLine{220   \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char}* PGP\_PRIVATE\_KEY\_BEGIN;           }
\DoxyCodeLine{221   \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char}* GPG\_FRONTEND\_SHORT\_CRYPTO\_HEAD;  }
\DoxyCodeLine{222 \};}
\DoxyCodeLine{223 }
\DoxyCodeLine{224 \}  \textcolor{comment}{// namespace GpgFrontend}}
\DoxyCodeLine{225 }
\DoxyCodeLine{226 \textcolor{preprocessor}{\#endif  }\textcolor{comment}{// GPG\_CONSTANTS\_H}}

\end{DoxyCode}
