added json to global results
This commit is contained in:
@@ -390,31 +390,14 @@ void clearGlobalBuffer() { globalOutputBuffer = ""; }
|
|||||||
const string& getGlobalBuffer() { return globalOutputBuffer; }
|
const string& getGlobalBuffer() { return globalOutputBuffer; }
|
||||||
|
|
||||||
set<short*> allocated;
|
set<short*> allocated;
|
||||||
set<int*> allocatedInt;
|
|
||||||
static void convertGlobalBuffer(short *&result, int *&resultSize)
|
|
||||||
{
|
|
||||||
const unsigned len = (unsigned)globalOutputBuffer.size();
|
|
||||||
result = new short[len + 1];
|
|
||||||
allocated.insert(result);
|
|
||||||
|
|
||||||
result[len] = '\0';
|
|
||||||
for (unsigned i = 0; i < len; ++i)
|
|
||||||
result[i] = globalOutputBuffer[i];
|
|
||||||
|
|
||||||
resultSize = new int[1];
|
|
||||||
resultSize[0] = (int)len;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern map<string, vector<Messages>> SPF_messages; //file ->messages
|
extern map<string, vector<Messages>> SPF_messages; //file ->messages
|
||||||
void clearGlobalMessagesBuffer()
|
void clearGlobalMessagesBuffer()
|
||||||
{
|
{
|
||||||
//clear allocated memory
|
//clear allocated memory
|
||||||
for (auto& elem : allocated)
|
for (auto& elem : allocated)
|
||||||
delete[]elem;
|
delete []elem;
|
||||||
for (auto& elem : allocatedInt)
|
|
||||||
delete[]elem;
|
|
||||||
allocated.clear();
|
allocated.clear();
|
||||||
allocatedInt.clear();
|
|
||||||
|
|
||||||
SPF_messages.clear();
|
SPF_messages.clear();
|
||||||
}
|
}
|
||||||
@@ -451,7 +434,7 @@ static map<string, vector<Messages>> removeCopies(map<string, vector<Messages>>
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void convertGlobalMessagesBuffer(short *&result, int *&resultSize)
|
static string convertGlobalMessagesBuffer()
|
||||||
{
|
{
|
||||||
auto copySPF_messages = removeCopies(SPF_messages);
|
auto copySPF_messages = removeCopies(SPF_messages);
|
||||||
for (auto &byFile : copySPF_messages)
|
for (auto &byFile : copySPF_messages)
|
||||||
@@ -489,21 +472,13 @@ static void convertGlobalMessagesBuffer(short *&result, int *&resultSize)
|
|||||||
json all;
|
json all;
|
||||||
all["allMessages"] = allMessages;
|
all["allMessages"] = allMessages;
|
||||||
|
|
||||||
const string str = all.dump();
|
return all.dump();
|
||||||
const unsigned len = (unsigned)str.size();
|
|
||||||
|
|
||||||
copyStringToShort(result, str);
|
|
||||||
allocated.insert(result);
|
|
||||||
|
|
||||||
resultSize = new int[1];
|
|
||||||
resultSize[0] = (int)len;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void convertBuffers(string &resultM, string &result)
|
||||||
void convertBuffers(short*& resultM, int*& resultSizeM, short*& result, int*& resultSize)
|
|
||||||
{
|
{
|
||||||
convertGlobalMessagesBuffer(resultM, resultSizeM);
|
resultM = convertGlobalMessagesBuffer();
|
||||||
convertGlobalBuffer(result, resultSize);
|
result = getGlobalBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSPF_comment(const string &bufStr)
|
bool isSPF_comment(const string &bufStr)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ void addToGlobalBufferAndPrint(const std::string &toPrint);
|
|||||||
void clearGlobalBuffer();
|
void clearGlobalBuffer();
|
||||||
const std::string& getGlobalBuffer();
|
const std::string& getGlobalBuffer();
|
||||||
std::wstring to_wstring(const std::string);
|
std::wstring to_wstring(const std::string);
|
||||||
void convertBuffers(short*& resultM, int*& resultSizeM, short*& result, int*& resultSize);
|
void convertBuffers(std::string& resultM, std::string& result);
|
||||||
void clearGlobalMessagesBuffer();
|
void clearGlobalMessagesBuffer();
|
||||||
std::string renameInclude(const std::string& inc);
|
std::string renameInclude(const std::string& inc);
|
||||||
void copyIncludes(const std::set<std::string> &allIncludeFiles, const std::map<std::string, std::map<int, std::set<std::string>>> &commentsToInclude, const std::map<std::string, std::map<int, std::set<std::string>>>& newCopyDeclToIncl, const char *folderName, bool keepSpfDirs, bool isFreeStyle, bool isRename, int removeDirs = 0);
|
void copyIncludes(const std::set<std::string> &allIncludeFiles, const std::map<std::string, std::map<int, std::set<std::string>>> &commentsToInclude, const std::map<std::string, std::map<int, std::set<std::string>>>& newCopyDeclToIncl, const char *folderName, bool keepSpfDirs, bool isFreeStyle, bool isRename, int removeDirs = 0);
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION_SPF "2444"
|
#define VERSION_SPF "2445"
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user