Skip to content

Commit 11b8d28

Browse files
authored
Mark StringUtils::format deprecated, use fmt::format instead (#2029)
1 parent 94069cb commit 11b8d28

File tree

46 files changed

+146
-146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+146
-146
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- Rename all AXLOG/printf to AXLOGD (without .\core, .\3rdparty) by @aismann in https://github.com/axmolengine/axmol/pull/2020
2121
- Set several log messages to verbose level by @rh101 in https://github.com/axmolengine/axmol/pull/2021
2222
- Change AXLOGI to more appropriate AXLOGD for several log calls by @rh101 in https://github.com/axmolengine/axmol/pull/2028
23+
- `StringUtils::format`, use `fmt::format` instead.
2324

2425
### Bug Fixes
2526

core/2d/Action.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Action::~Action()
4747

4848
std::string Action::description() const
4949
{
50-
return StringUtils::format("<Action | Tag = %d", _tag);
50+
return fmt::format("<Action | Tag = {}", _tag);
5151
}
5252

5353
void Action::startWithTarget(Node* aTarget)

core/2d/FastTMXLayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ void FastTMXLayer::setupTileSprite(Sprite* sprite, const Vec2& pos, uint32_t gid
962962

963963
std::string FastTMXLayer::getDescription() const
964964
{
965-
return StringUtils::format("<FastTMXLayer | tag = %d, size = %d,%d>", _tag, (int)_mapTileSize.width,
965+
return fmt::format("<FastTMXLayer | tag = {}, size = {},{}>", _tag, (int)_mapTileSize.width,
966966
(int)_mapTileSize.height);
967967
}
968968

core/2d/FastTMXTiledMap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Value FastTMXTiledMap::getPropertiesForGID(int GID) const
260260

261261
std::string FastTMXTiledMap::getDescription() const
262262
{
263-
return StringUtils::format("<FastTMXTiledMap | Tag = %d, Layers = %d", _tag, static_cast<int>(_children.size()));
263+
return fmt::format("<FastTMXTiledMap | Tag = {}, Layers = {}", _tag, static_cast<int>(_children.size()));
264264
}
265265

266266
void FastTMXTiledMap::setTileAnimEnabled(bool enabled)

core/2d/FontFNT.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ BMFontConfiguration::~BMFontConfiguration()
126126

127127
std::string BMFontConfiguration::description() const
128128
{
129-
return StringUtils::format(
130-
"<BMFontConfiguration = " AX_FORMAT_PRINTF_SIZE_T " | Glphys:%d Kernings:%d | Image = %s>", (size_t)this,
131-
static_cast<int>(_fontDefDictionary.size()), static_cast<int>(_kerningDictionary.size()), _atlasName.c_str());
129+
return fmt::format(
130+
"<BMFontConfiguration = " AX_FORMAT_PRINTF_SIZE_T " | Glphys:{} Kernings:{} | Image = {}>", (size_t)this,
131+
static_cast<int>(_fontDefDictionary.size()), static_cast<int>(_kerningDictionary.size()), _atlasName);
132132
}
133133

134134
void BMFontConfiguration::purgeKerningDictionary()

core/2d/LabelAtlas.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void LabelAtlas::draw(Renderer* renderer, const Mat4& transform, uint32_t flags)
283283

284284
std::string LabelAtlas::getDescription() const
285285
{
286-
return StringUtils::format("<LabelAtlas | Tag = %d, Label = '%s'>", _tag, _string.c_str());
286+
return fmt::format("<LabelAtlas | Tag = {}, Label = '{}'>", _tag, _string);
287287
}
288288

289289
NS_AX_END

core/2d/Layer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ void LayerGradient::setCompressedInterpolation(bool compress)
336336

337337
std::string LayerGradient::getDescription() const
338338
{
339-
return StringUtils::format("<LayerGradient | Tag = %d>", _tag);
339+
return fmt::format("<LayerGradient | Tag = {}>", _tag);
340340
}
341341

342342
/**
@@ -750,7 +750,7 @@ void LayerMultiplex::switchToAndReleaseMe(int n)
750750

751751
std::string LayerMultiplex::getDescription() const
752752
{
753-
return StringUtils::format("<LayerMultiplex | Tag = %d, Layers = %d", _tag, static_cast<int>(_children.size()));
753+
return fmt::format("<LayerMultiplex | Tag = {}, Layers = {}", _tag, static_cast<int>(_children.size()));
754754
}
755755

756756
NS_AX_END

core/2d/Menu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ bool Menu::isOpacityModifyRGB() const
555555

556556
std::string Menu::getDescription() const
557557
{
558-
return StringUtils::format("<Menu | Tag = %d>", _tag);
558+
return fmt::format("<Menu | Tag = {}>", _tag);
559559
}
560560

561561
NS_AX_END

core/2d/MenuItem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void MenuItem::setCallback(const ccMenuCallback& callback)
125125

126126
std::string MenuItem::getDescription() const
127127
{
128-
return StringUtils::format("<MenuItem | tag = %d>", _tag);
128+
return fmt::format("<MenuItem | tag = {}>", _tag);
129129
}
130130

131131
//

core/2d/Node.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ void Node::cleanup()
240240

241241
std::string Node::getDescription() const
242242
{
243-
return StringUtils::format("<Node | Tag = %d", _tag);
243+
return fmt::format("<Node | Tag = {}", _tag);
244244
}
245245

246246
// MARK: getters / setters

0 commit comments

Comments
 (0)