From 38639a871676b0ff10b0516e3d1ea2e6dae9a697 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 9 Feb 2016 15:09:55 +0100 Subject: [PATCH] ZRCola normalization prepared --- lib/libZRCola/build/libZRCola.vcxproj | 3 ++ lib/libZRCola/build/libZRCola.vcxproj.filters | 9 +++++ lib/libZRCola/include/zrcola/normalize.h | 35 +++++++++++++++++++ lib/libZRCola/src/normalizations.cpp | 20 +++++++++++ lib/libZRCola/src/normalize.cpp | 25 +++++++++++++ lib/libZRCola/src/stdafx.h | 1 + 6 files changed, 93 insertions(+) create mode 100644 lib/libZRCola/include/zrcola/normalize.h create mode 100644 lib/libZRCola/src/normalizations.cpp create mode 100644 lib/libZRCola/src/normalize.cpp diff --git a/lib/libZRCola/build/libZRCola.vcxproj b/lib/libZRCola/build/libZRCola.vcxproj index 2e1a03f..66c5499 100644 --- a/lib/libZRCola/build/libZRCola.vcxproj +++ b/lib/libZRCola/build/libZRCola.vcxproj @@ -24,6 +24,8 @@ + + Create Create @@ -35,6 +37,7 @@ + diff --git a/lib/libZRCola/build/libZRCola.vcxproj.filters b/lib/libZRCola/build/libZRCola.vcxproj.filters index 7fba38b..3367f86 100644 --- a/lib/libZRCola/build/libZRCola.vcxproj.filters +++ b/lib/libZRCola/build/libZRCola.vcxproj.filters @@ -30,6 +30,12 @@ Source Files + + Source Files + + + Source Files + Source Files @@ -47,6 +53,9 @@ Header Files + + Header Files + diff --git a/lib/libZRCola/include/zrcola/normalize.h b/lib/libZRCola/include/zrcola/normalize.h new file mode 100644 index 0000000..a650bad --- /dev/null +++ b/lib/libZRCola/include/zrcola/normalize.h @@ -0,0 +1,35 @@ +/* + Copyright 2015-2016 Amebis + + This file is part of ZRCola. + + ZRCola is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ZRCola is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with ZRCola. If not, see . +*/ + +#pragma once + +#include "common.h" + + +namespace ZRCola { + /// + /// Normalizes a decomposed string + /// + /// \param[in] input Input string (UTF-16) + /// \param[in] inputMax Length of the input string in characters. Can be (size_t)-1 if \p input is zero terminated. + /// \param[out] output Output string (UTF-16) + /// \param[out] map The vector of source to destination index mappings (optional) + /// + void ZRCOLA_API Normalize(_In_z_count_(inputMax) const wchar_t* input, _In_ size_t inputMax, _Out_ std::wstring &output, _Out_opt_ std::vector* map = NULL); +}; diff --git a/lib/libZRCola/src/normalizations.cpp b/lib/libZRCola/src/normalizations.cpp new file mode 100644 index 0000000..ac111f1 --- /dev/null +++ b/lib/libZRCola/src/normalizations.cpp @@ -0,0 +1,20 @@ +/* + Copyright 2015-2016 Amebis + + This file is part of ZRCola. + + ZRCola is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ZRCola is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with ZRCola. If not, see . +*/ + +#include "stdafx.h" diff --git a/lib/libZRCola/src/normalize.cpp b/lib/libZRCola/src/normalize.cpp new file mode 100644 index 0000000..102197c --- /dev/null +++ b/lib/libZRCola/src/normalize.cpp @@ -0,0 +1,25 @@ +/* + Copyright 2015-2016 Amebis + + This file is part of ZRCola. + + ZRCola is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ZRCola is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with ZRCola. If not, see . +*/ + +#include "stdafx.h" + + +void ZRCOLA_API ZRCola::Normalize(_In_z_count_(inputMax) const wchar_t* input, _In_ size_t inputMax, _Out_ std::wstring &output, _Out_opt_ std::vector* map) +{ +} diff --git a/lib/libZRCola/src/stdafx.h b/lib/libZRCola/src/stdafx.h index fd42669..4b2b12b 100644 --- a/lib/libZRCola/src/stdafx.h +++ b/lib/libZRCola/src/stdafx.h @@ -22,6 +22,7 @@ #include "../../../include/zrcola.h" #include "../include/zrcola/compose.h" #include "../include/zrcola/decompose.h" +#include "../include/zrcola/normalize.h" namespace ZRCola {