mirror of
https://github.com/msojocs/wx-compiler.git
synced 2025-07-19 00:00:04 +08:00
feat: NameAllocator::GetNextName
This commit is contained in:
parent
91d1768c96
commit
58d0b883d3
@ -28,8 +28,9 @@ namespace WXML
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
/* data */
|
/* data */
|
||||||
std::string offset_1; // v5
|
int offset_0 = 0;
|
||||||
std::string offset_7; // v4
|
std::string offset_4;
|
||||||
|
std::string offset_28;
|
||||||
public:
|
public:
|
||||||
std::string ALPAHBET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
|
std::string ALPAHBET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
|
||||||
static int ALPAHBETLEN;
|
static int ALPAHBETLEN;
|
||||||
@ -396,8 +397,6 @@ namespace WXML
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Compiler
|
namespace Compiler
|
||||||
|
@ -7,15 +7,23 @@ namespace WXML {
|
|||||||
{
|
{
|
||||||
NameAllocator::ALPAHBETLEN = NameAllocator::ALPAHBET.size();
|
NameAllocator::ALPAHBETLEN = NameAllocator::ALPAHBET.size();
|
||||||
}
|
}
|
||||||
this->offset_1.assign(a2);
|
this->offset_4.assign(a2);
|
||||||
this->offset_7.assign(a3);
|
this->offset_28.assign(a3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO:
|
|
||||||
*/
|
|
||||||
void NameAllocator::GetNextName(std::string & a2)
|
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();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user