mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 14:07:46 +00:00
Merge branch 'master' of https://github.com/SapphireMordred/Sapphire
This commit is contained in:
commit
11fd28e078
1 changed files with 38 additions and 1 deletions
|
@ -25,12 +25,33 @@
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <streambuf>
|
#include <streambuf>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
#include <boost/archive/iterators/ostream_iterator.hpp>
|
||||||
|
|
||||||
|
|
||||||
Core::Logger g_log;
|
Core::Logger g_log;
|
||||||
Core::Data::ExdData g_exdData;
|
Core::Data::ExdData g_exdData;
|
||||||
bool skipUnmapped = true;
|
bool skipUnmapped = true;
|
||||||
|
|
||||||
|
std::map< char, std::string > numberToStringMap
|
||||||
|
{
|
||||||
|
{ '0', "zero" },
|
||||||
|
{ '1', "one" },
|
||||||
|
{ '2', "two" },
|
||||||
|
{ '3', "three" },
|
||||||
|
{ '4', "four" },
|
||||||
|
{ '5', "five" },
|
||||||
|
{ '6', "six" },
|
||||||
|
{ '7', "seven" },
|
||||||
|
{ '8', "eight" },
|
||||||
|
{ '9', "nine" },
|
||||||
|
};
|
||||||
|
|
||||||
|
std::vector< std::string > cppKeyWords
|
||||||
|
{
|
||||||
|
"new",
|
||||||
|
"class"
|
||||||
|
};
|
||||||
|
|
||||||
//std::string datLocation( "/opt/sapphire_3_15_0/bin/sqpack" );
|
//std::string datLocation( "/opt/sapphire_3_15_0/bin/sqpack" );
|
||||||
std::string datLocation( "C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack" );
|
std::string datLocation( "C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack" );
|
||||||
std::map< uint8_t, std::string > g_typeMap;
|
std::map< uint8_t, std::string > g_typeMap;
|
||||||
|
@ -180,6 +201,22 @@ std::string generateStruct( const std::string &exd )
|
||||||
}
|
}
|
||||||
fieldName[0] = std::tolower( fieldName[0] );
|
fieldName[0] = std::tolower( fieldName[0] );
|
||||||
fieldName.erase( boost::remove_if( fieldName, boost::is_any_of(",-':![](){}<>% \x02\x1f\x01\x03") ), fieldName.end() );
|
fieldName.erase( boost::remove_if( fieldName, boost::is_any_of(",-':![](){}<>% \x02\x1f\x01\x03") ), fieldName.end() );
|
||||||
|
|
||||||
|
for( auto entry : numberToStringMap )
|
||||||
|
{
|
||||||
|
if( fieldName[0] == entry.first )
|
||||||
|
{
|
||||||
|
fieldName.erase( 0, 1 );
|
||||||
|
fieldName.insert( 0, entry.second );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for( std::string keyword : cppKeyWords )
|
||||||
|
{
|
||||||
|
if( fieldName == keyword )
|
||||||
|
fieldName[0] = toupper( fieldName[0] );
|
||||||
|
}
|
||||||
|
|
||||||
indexToNameMap[count] = fieldName;
|
indexToNameMap[count] = fieldName;
|
||||||
indexToTypeMap[count] = type;
|
indexToTypeMap[count] = type;
|
||||||
if( indexToTarget.find( count ) != indexToTarget.end() )
|
if( indexToTarget.find( count ) != indexToTarget.end() )
|
||||||
|
|
Loading…
Add table
Reference in a new issue