C++ Utilities
5.5.0
Useful C++ classes and routines such as argument parser, IO and conversion utilities
misc
levenshtein.h
Go to the documentation of this file.
1
#ifndef CPP_UTILITIES_LEVENSHTEIN_H
2
#define CPP_UTILITIES_LEVENSHTEIN_H
3
4
#include "../global.h"
5
6
#include <cstring>
7
#include <string>
8
9
namespace
CppUtilities
{
10
11
CPP_UTILITIES_EXPORT
std::size_t
computeDamerauLevenshteinDistance
(
const
char
*str1, std::size_t size1,
const
char
*str2, std::size_t size2);
12
13
inline
std::size_t
computeDamerauLevenshteinDistance
(
const
std::string &str1,
const
std::string &str2)
14
{
15
return
computeDamerauLevenshteinDistance
(str1.data(), str1.size(), str2.data(), str2.size());
16
}
17
18
inline
std::size_t
computeDamerauLevenshteinDistance
(
const
char
*str1,
const
char
*str2)
19
{
20
return
computeDamerauLevenshteinDistance
(str1, std::strlen(str1), str2, std::strlen(str2));
21
}
22
23
}
// namespace CppUtilities
24
25
#endif // CPP_UTILITIES_LEVENSHTEIN_H
CppUtilities
Contains all utilities provides by the c++utilities library.
Definition:
argumentparser.h:17
CppUtilities::computeDamerauLevenshteinDistance
CPP_UTILITIES_EXPORT std::size_t computeDamerauLevenshteinDistance(const char *str1, std::size_t size1, const char *str2, std::size_t size2)
CPP_UTILITIES_EXPORT
#define CPP_UTILITIES_EXPORT
Marks the symbol to be exported by the c++utilities library.
Generated on Tue Jul 7 2020 10:21:21 for C++ Utilities by
1.8.18