-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
399 additions
and
375 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include <impl/MorpheusOracle_Loader_Utils.hpp> | ||
|
||
namespace Morpheus { | ||
namespace Oracle { | ||
namespace Impl { | ||
|
||
void tokenize(std::vector<std::string>& tokens, const std::string& str, | ||
const std::string& delimiters) { | ||
// Skip delimiters at beginning. | ||
std::string::size_type lastPos = str.find_first_not_of(delimiters, 0); | ||
// Find first "non-delimiter". | ||
std::string::size_type pos = str.find_first_of(delimiters, lastPos); | ||
|
||
while (std::string::npos != pos || std::string::npos != lastPos) { | ||
// Found a token, add it to the vector. | ||
tokens.push_back(str.substr(lastPos, pos - lastPos)); | ||
// Skip delimiters. Note the "not_of" | ||
lastPos = str.find_first_not_of(delimiters, pos); | ||
// Find next "non-delimiter" | ||
pos = str.find_first_of(delimiters, lastPos); | ||
} | ||
} | ||
|
||
} // namespace Impl | ||
} // namespace Oracle | ||
} // namespace Morpheus |
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
Oops, something went wrong.