-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#950: refactor options line parser v2 (#448)
related to exasol/script-languages-release#950
- Loading branch information
Showing
21 changed files
with
492 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
exaudfclient/base/javacontainer/script_options/checksum.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "base/javacontainer/script_options/checksum.h" | ||
#include <openssl/md5.h> | ||
#include <string.h> | ||
|
||
namespace SWIGVMContainers { | ||
|
||
namespace JavaScriptOptions { | ||
|
||
inline std::vector<unsigned char> scriptToMd5(const char *script) { | ||
MD5_CTX ctx; | ||
unsigned char md5[MD5_DIGEST_LENGTH]; | ||
MD5_Init(&ctx); | ||
MD5_Update(&ctx, script, strlen(script)); | ||
MD5_Final(md5, &ctx); | ||
return std::vector<unsigned char>(md5, md5 + sizeof(md5)); | ||
} | ||
|
||
|
||
bool Checksum::addScript(const char *script) { | ||
return m_importedScriptChecksums.insert(scriptToMd5(script)).second; | ||
} | ||
|
||
|
||
} //namespace JavaScriptOptions | ||
|
||
} //namespace SWIGVMContainers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef SCRIPTOPTIONLINEPARSERCHECKSUM_H | ||
#define SCRIPTOPTIONLINEPARSERCHECKSUM_H 1 | ||
|
||
#include <string> | ||
#include <vector> | ||
#include <set> | ||
|
||
|
||
namespace SWIGVMContainers { | ||
|
||
namespace JavaScriptOptions { | ||
|
||
class Checksum { | ||
|
||
public: | ||
Checksum() = default; | ||
|
||
bool addScript(const char *script); | ||
|
||
private: | ||
std::set<std::vector<unsigned char> > m_importedScriptChecksums; | ||
}; | ||
|
||
|
||
} //namespace JavaScriptOptions | ||
|
||
} //namespace SWIGVMContainers | ||
|
||
#endif //SCRIPTOPTIONLINEPARSERCHECKSUM_H |
133 changes: 32 additions & 101 deletions
133
exaudfclient/base/javacontainer/script_options/converter.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.