mirror of
https://github.com/open-goal/jak-project
synced 2026-05-31 01:16:12 -04:00
docs - first chunk of work documenting the files I glossed over (#2130)
- started documenting the files I glossed over, some are totally done, others are just partially done - I changed the decompiler to automatically initialize the art-group-info from the json file. This makes updating gsrc, even a single file at a time, have consistent naming - Though I disabled this functionality for jak 1, as I have no idea if using the ntsc art groups will cause a regression for different versions - fix indentation for docstrings -- it still doesn't look great, but this is now a formatting concern, rather than the docstring having a bunch of happen-stance leading whitespace.
This commit is contained in:
@@ -38,6 +38,25 @@ std::string trim(const std::string& s) {
|
||||
return rtrim(ltrim(s));
|
||||
}
|
||||
|
||||
std::string trim_newline_indents(const std::string& s) {
|
||||
auto lines = split(s, '\n');
|
||||
std::vector<std::string> trimmed_lines;
|
||||
std::transform(lines.begin(), lines.end(), std::back_inserter(trimmed_lines),
|
||||
[](const std::string& line) { return ltrim(line); });
|
||||
return join(trimmed_lines, "\n");
|
||||
}
|
||||
|
||||
std::string join(const std::vector<std::string>& strs, const std::string& join_with) {
|
||||
std::string out;
|
||||
for (int i = 0; i < strs.size(); i++) {
|
||||
out += strs.at(i);
|
||||
if (i < strs.size() - 1) {
|
||||
out += join_with;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
int line_count(const std::string& str) {
|
||||
int result = 0;
|
||||
for (auto& c : str) {
|
||||
|
||||
Reference in New Issue
Block a user