Skip to content

Commit 3eca23a

Browse files
author
전상현
committed
[300_Formatter] 포인형 vector 인터페이스 추가
1 parent 5d51d5b commit 3eca23a

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

Src/000_String/NumericString.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ namespace core
8585
float FloatFrom(std::string strNum);
8686
double DoubleFrom(std::string strNum);
8787

88+
bool BoolFrom(std::wstring strNum);
8889
char CharFrom(std::wstring strNum);
8990
short ShortFrom(std::wstring strNum);
9091
int IntFrom(std::wstring strNum);

Src/300_Formatter/Interface.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,24 @@ namespace core
188188
return *this;
189189
}
190190

191+
template<typename T>
192+
core::IFormatterA& Sync(std::string& strKey, std::vector<T*>* pVecObject)
193+
{
194+
const size_t tSize = _BeginArrayGrouping(strKey, pVecObject->size());
195+
pVecObject->resize(tSize);
196+
197+
size_t i;
198+
for (i = 0; i < tSize; i++)
199+
{
200+
_BeginArrayItem(i, tSize);
201+
Sync(strKey, (*pVecObject)[i]);
202+
_EndArrayItem(i, tSize);
203+
}
204+
205+
_EndArrayGrouping();
206+
return *this;
207+
}
208+
191209
template<typename T>
192210
core::IFormatterA& Sync(std::string& strKey, std::set<T>* pSetObject)
193211
{
@@ -419,6 +437,24 @@ namespace core
419437
return *this;
420438
}
421439

440+
template<typename T>
441+
core::IFormatterW& Sync(std::wstring& strKey, std::vector<T*>* pVecObject)
442+
{
443+
const size_t tSize = _BeginArrayGrouping(strKey, pVecObject->size());
444+
pVecObject->resize(tSize);
445+
446+
size_t i;
447+
for (i = 0; i < tSize; i++)
448+
{
449+
_BeginArrayItem(i, tSize);
450+
Sync(strKey, (*pVecObject)[i]);
451+
_EndArrayItem(i, tSize);
452+
}
453+
454+
_EndArrayGrouping();
455+
return *this;
456+
}
457+
422458
template<typename T>
423459
core::IFormatterW& Sync(std::wstring& strKey, std::set<T>* pSetObject)
424460
{

0 commit comments

Comments
 (0)