File tree Expand file tree Collapse file tree 5 files changed +18
-33
lines changed Expand file tree Collapse file tree 5 files changed +18
-33
lines changed Original file line number Diff line number Diff line change @@ -70,31 +70,18 @@ bool fx_ver_t::operator >=(const fx_ver_t& b) const
70
70
71
71
pal::string_t fx_ver_t::as_str () const
72
72
{
73
- pal::stringstream_t stream;
74
- stream << m_major << _X (" ." ) << m_minor << _X (" ." ) << m_patch;
73
+ pal::string_t version = pal::to_string (m_major);
74
+ version += _X (' .' );
75
+ version += pal::to_string (m_minor);
76
+ version += _X (' .' );
77
+ version += pal::to_string (m_patch);
75
78
if (!m_pre.empty ())
76
- {
77
- stream << m_pre;
78
- }
79
- if (!m_build.empty ())
80
- {
81
- stream << m_build;
82
- }
83
- return stream.str ();
84
- }
79
+ version += m_pre;
85
80
86
- pal::string_t fx_ver_t::prerelease_glob () const
87
- {
88
- pal::stringstream_t stream;
89
- stream << m_major << _X (" ." ) << m_minor << _X (" ." ) << m_patch << _X (" -*" );
90
- return stream.str ();
91
- }
81
+ if (!m_build.empty ())
82
+ version += m_build;
92
83
93
- pal::string_t fx_ver_t::patch_glob () const
94
- {
95
- pal::stringstream_t stream;
96
- stream << m_major << _X (" ." ) << m_minor << _X (" .*" );
97
- return stream.str ();
84
+ return version;
98
85
}
99
86
100
87
static pal::string_t getId (const pal::string_t &ids, size_t idStart)
Original file line number Diff line number Diff line change @@ -26,8 +26,6 @@ struct fx_ver_t
26
26
bool is_empty () const { return m_major == -1 ; }
27
27
28
28
pal::string_t as_str () const ;
29
- pal::string_t prerelease_glob () const ;
30
- pal::string_t patch_glob () const ;
31
29
32
30
bool operator ==(const fx_ver_t & b) const ;
33
31
bool operator !=(const fx_ver_t & b) const ;
Original file line number Diff line number Diff line change 16
16
#include < fcntl.h>
17
17
#include < fnmatch.h>
18
18
#include < ctime>
19
- #include < locale>
20
19
#include < pwd.h>
21
20
#include " config.h"
22
21
#include < minipal/getexepath.h>
Original file line number Diff line number Diff line change 7
7
#include " longfile.h"
8
8
9
9
#include < cassert>
10
- #include < locale>
11
10
#include < ShlObj.h>
12
11
#include < ctime>
13
12
Original file line number Diff line number Diff line change @@ -51,29 +51,31 @@ bool version_t::operator >=(const version_t& b) const
51
51
52
52
pal::string_t version_t::as_str () const
53
53
{
54
- pal::stringstream_t stream;
55
-
54
+ pal::string_t version;
56
55
if (m_major >= 0 )
57
56
{
58
- stream << m_major;
57
+ version += pal::to_string ( m_major) ;
59
58
60
59
if (m_minor >= 0 )
61
60
{
62
- stream << _X (" ." ) << m_minor;
61
+ version += _X (' .' );
62
+ version += pal::to_string (m_minor);
63
63
64
64
if (m_build >= 0 )
65
65
{
66
- stream << _X (" ." ) << m_build;
66
+ version += _X (' .' );
67
+ version += pal::to_string (m_build);
67
68
68
69
if (m_revision >= 0 )
69
70
{
70
- stream << _X (" ." ) << m_revision;
71
+ version += _X (' .' );
72
+ version += pal::to_string (m_revision);
71
73
}
72
74
}
73
75
}
74
76
}
75
77
76
- return stream. str () ;
78
+ return version ;
77
79
}
78
80
79
81
/* static*/ int version_t::compare (const version_t &a, const version_t & b)
You can’t perform that action at this time.
0 commit comments