mirror of
https://github.com/open-goal/jak-project
synced 2026-05-27 16:14:18 -04:00
ac3c4e59b0
This allows you to not have to define the entire file path to a source file to re-compile and load it. Technically a stop-gap until editor tools are developed around writing OpenGOAL.  As opposed to `(ml "goal_src/jak2/engine/game/main.gc")` (which still works) This is accomplished via the following config (connection attempts is irrelevant): ```json { "numConnectToTargetAttempts": 1, "jak2": { "asmFileSearchDirs": [ "goal_src/jak2" ] } } ``` This also provides a way to make game-specific configurations for the REPL fairly easily.
25 lines
604 B
C++
25 lines
604 B
C++
#include "StringUtil.h"
|
|
|
|
namespace str_util {
|
|
|
|
const std::string WHITESPACE = " \n\r\t\f\v";
|
|
|
|
bool starts_with(const std::string& s, const std::string& prefix) {
|
|
return s.rfind(prefix) == 0;
|
|
}
|
|
|
|
std::string ltrim(const std::string& s) {
|
|
size_t start = s.find_first_not_of(WHITESPACE);
|
|
return (start == std::string::npos) ? "" : s.substr(start);
|
|
}
|
|
|
|
std::string rtrim(const std::string& s) {
|
|
size_t end = s.find_last_not_of(WHITESPACE);
|
|
return (end == std::string::npos) ? "" : s.substr(0, end + 1);
|
|
}
|
|
|
|
std::string trim(const std::string& s) {
|
|
return rtrim(ltrim(s));
|
|
}
|
|
} // namespace str_util
|