Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
6ebc1a96
Commit
6ebc1a96
authored
May 20, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge locale.h into format-inl.h
parent
6966db1d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
29 deletions
+12
-29
CMakeLists.txt
CMakeLists.txt
+2
-2
include/fmt/format-inl.h
include/fmt/format-inl.h
+10
-1
include/fmt/locale.h
include/fmt/locale.h
+0
-25
test/util-test.cc
test/util-test.cc
+0
-1
No files found.
CMakeLists.txt
View file @
6ebc1a96
...
...
@@ -95,8 +95,8 @@ function(add_headers VAR)
endfunction
()
# Define the fmt library, its includes and the needed defines.
add_headers
(
FMT_HEADERS core.h format.h format-inl.h
locale.h ostream.h printf
.h
time.h
ranges.h
)
add_headers
(
FMT_HEADERS core.h format.h format-inl.h
ostream.h printf.h time
.h
ranges.h
)
set
(
FMT_SOURCES src/format.cc
)
if
(
HAVE_OPEN
)
add_headers
(
FMT_HEADERS posix.h
)
...
...
include/fmt/format-inl.h
View file @
6ebc1a96
...
...
@@ -9,7 +9,6 @@
#define FMT_FORMAT_INL_H_
#include "format.h"
#include "locale.h"
#include <string.h>
...
...
@@ -19,6 +18,7 @@
#include <cmath>
#include <cstdarg>
#include <cstddef> // for std::ptrdiff_t
#include <locale>
#if defined(_WIN32) && defined(__MINGW32__)
# include <cstring>
...
...
@@ -205,6 +205,15 @@ void report_error(FormatFunc func, int error_code,
}
}
// namespace
class
locale
{
private:
std
::
locale
locale_
;
public:
explicit
locale
(
std
::
locale
loc
=
std
::
locale
())
:
locale_
(
loc
)
{}
std
::
locale
get
()
{
return
locale_
;
}
};
template
<
typename
Char
>
FMT_FUNC
Char
internal
::
thousands_sep
(
locale_provider
*
lp
)
{
std
::
locale
loc
=
lp
?
lp
->
locale
().
get
()
:
std
::
locale
();
...
...
include/fmt/locale.h
deleted
100644 → 0
View file @
6966db1d
// Formatting library for C++ - locale support
//
// Copyright (c) 2012 - 2016, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#ifndef FMT_LOCALE_H_
#define FMT_LOCALE_H_
#include "format.h"
#include <locale>
FMT_BEGIN_NAMESPACE
class
locale
{
private:
std
::
locale
locale_
;
public:
explicit
locale
(
std
::
locale
loc
=
std
::
locale
())
:
locale_
(
loc
)
{}
std
::
locale
get
()
{
return
locale_
;
}
};
FMT_END_NAMESPACE
#endif // FMT_LOCALE_
test/util-test.cc
View file @
6ebc1a96
...
...
@@ -17,7 +17,6 @@
# include <type_traits>
#endif
#include "fmt/locale.h"
#include "gmock/gmock.h"
#include "gtest-extra.h"
#include "mock-allocator.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment