feat: NameAllocator::GetNextName

This commit is contained in:
msojocs 2023-07-03 22:55:30 +08:00
parent 91d1768c96
commit 58d0b883d3
2 changed files with 17 additions and 10 deletions

View File

@ -28,8 +28,9 @@ namespace WXML
{
private:
/* data */
std::string offset_1; // v5
std::string offset_7; // v4
int offset_0 = 0;
std::string offset_4;
std::string offset_28;
public:
std::string ALPAHBET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
static int ALPAHBETLEN;
@ -395,8 +396,6 @@ namespace WXML
void ATTR();
};
};

View File

@ -7,15 +7,23 @@ namespace WXML {
{
NameAllocator::ALPAHBETLEN = NameAllocator::ALPAHBET.size();
}
this->offset_1.assign(a2);
this->offset_7.assign(a3);
this->offset_4.assign(a2);
this->offset_28.assign(a3);
}
/**
* TODO:
*/
void NameAllocator::GetNextName(std::string & a2)
{
std::stringstream ss;
ss << this->offset_4 << this->offset_28[this->offset_0 % this->offset_28.length()];
int v9 = this->offset_0;
while (v9)
{
ss << WXML::NameAllocator::ALPAHBET[v9 % WXML::NameAllocator::ALPAHBETLEN];
v9 /= WXML::NameAllocator::ALPAHBETLEN;
}
this->offset_0++;
a2 = ss.str();
}