projects
/
libdcp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Write MCA tags based on the specified sound field.
[libdcp.git]
/
src
/
locale_convert.h
diff --git
a/src/locale_convert.h
b/src/locale_convert.h
index 0572840915de05bc80f3d1f9c6880e82f8ea8162..37510a96d32ca08e046335af1991b98e6147b3ed 100644
(file)
--- a/
src/locale_convert.h
+++ b/
src/locale_convert.h
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2016
-2021
Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
This file is part of libdcp.
@@
-31,26
+31,46
@@
files in the program, then also delete it here.
*/
files in the program, then also delete it here.
*/
+
+/** @file src/locale_convert.cc
+ * @brief Methods to convert to/from string using the current locale
+ */
+
+
#ifndef LIBDCP_LOCALE_CONVERT_H
#define LIBDCP_LOCALE_CONVERT_H
#ifndef LIBDCP_LOCALE_CONVERT_H
#define LIBDCP_LOCALE_CONVERT_H
+
+#include "util.h"
#include <boost/filesystem.hpp>
#include <boost/static_assert.hpp>
#include <string>
#include <cstdio>
#include <boost/filesystem.hpp>
#include <boost/static_assert.hpp>
#include <string>
#include <cstdio>
+
namespace dcp {
namespace dcp {
+
template <typename P, typename Q>
P
template <typename P, typename Q>
P
-locale_convert (Q
x
, int precision = 16, bool fixed = false)
+locale_convert (Q, int precision = 16, bool fixed = false)
{
/* We can't write a generic version of locale_convert; all required
versions must be specialised.
*/
BOOST_STATIC_ASSERT (sizeof (Q) == 0);
{
/* We can't write a generic version of locale_convert; all required
versions must be specialised.
*/
BOOST_STATIC_ASSERT (sizeof (Q) == 0);
+ LIBDCP_UNUSED(precision);
+ LIBDCP_UNUSED(fixed);
}
}
+template <>
+std::string
+locale_convert (unsigned char x, int, bool);
+
+template <>
+std::string
+locale_convert (unsigned short int x, int, bool);
+
template <>
std::string
locale_convert (int x, int, bool);
template <>
std::string
locale_convert (int x, int, bool);
@@
-107,12
+127,36
@@
template <>
std::string
locale_convert (boost::filesystem::path x, int, bool);
std::string
locale_convert (boost::filesystem::path x, int, bool);
+template <>
+unsigned char
+locale_convert (std::string x, int, bool);
+
+template <>
+unsigned short int
+locale_convert (std::string x, int, bool);
+
+template <>
+unsigned int
+locale_convert (std::string x, int, bool);
+
template <>
int
locale_convert (std::string x, int, bool);
template <>
template <>
int
locale_convert (std::string x, int, bool);
template <>
-long int
+long
+locale_convert (std::string x, int, bool);
+
+template <>
+unsigned long
+locale_convert (std::string x, int, bool);
+
+template <>
+long long
+locale_convert (std::string x, int, bool);
+
+template <>
+unsigned long long
locale_convert (std::string x, int, bool);
template <>
locale_convert (std::string x, int, bool);
template <>
@@
-123,6
+167,8
@@
template <>
double
locale_convert (std::string x, int, bool);
double
locale_convert (std::string x, int, bool);
+
}
}
+
#endif
#endif