lib/icu/CaseFold: rename to IcuCanonicalize() and add flag parameter

Prepare for adding more transformations.
This commit is contained in:
Max Kellermann
2022-11-15 17:09:02 +01:00
parent 852df2239e
commit 8b72cb64b2
4 changed files with 30 additions and 24 deletions

View File

@@ -0,0 +1,41 @@
/*
* Copyright 2003-2022 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program 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 2 of the License, or
* (at your option) any later version.
*
* This program 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 this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#include "config.h"
#ifdef HAVE_ICU
#define HAVE_ICU_CANONICALIZE
#include <string_view>
class AllocatedString;
/**
* Transform the given string to "canonical" form to allow fuzzy
* string comparisons. The full set of features (if ICU is being
* used):
*
* - case folding (optional)
*/
AllocatedString
IcuCanonicalize(std::string_view src, bool fold_case) noexcept;
#endif