| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -3116,13 +3116,40 @@ static std::string getIncludePathFileName(const std::string &includePath, const | |
| return path + header; | ||
| } | ||
|
|
||
| #ifdef __APPLE__ | ||
| static std::string get_apple_framework_relative_path(const std::string& header) | ||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityPlease try to use the same naming style (e.g. camel case) as the rest of the code.
Sorry, something went wrong.
All reactions
|
||
| { | ||
| std::string appleFrameworkHeader = {header}; | ||
| // try the Framework path on Mac, if there is a path in front | ||
| // ### what about escaped slashes? | ||
| size_t slashPos = appleFrameworkHeader.find('/'); | ||
| if (slashPos != std::string::npos) | ||
| { | ||
| constexpr auto framework_separator{ ".framework/Headers" }; | ||
| appleFrameworkHeader.insert(slashPos, framework_separator); | ||
| } | ||
| return appleFrameworkHeader; | ||
| } | ||
| #endif // __APPLE__ | ||
|
|
||
| static std::string openHeaderIncludePath(std::ifstream &f, const simplecpp::DUI &dui, const std::string &header) | ||
| { | ||
| for (std::list<std::string>::const_iterator it = dui.includePaths.begin(); it != dui.includePaths.end(); ++it) { | ||
| std::string simplePath = openHeader(f, getIncludePathFileName(*it, header)); | ||
| if (!simplePath.empty()) | ||
| return simplePath; | ||
| } | ||
| #ifdef __APPLE__ | ||
| std::string appleFrameworkHeader = get_apple_framework_relative_path(header); | ||
| if (appleFrameworkHeader != header) | ||
| { | ||
| for (std::list<std::string>::const_iterator it = dui.includePaths.begin(); it != dui.includePaths.end(); ++it) { | ||
| std::string simplePath = openHeader(f, getIncludePathFileName(*it, appleFrameworkHeader)); | ||
| if (!simplePath.empty()) | ||
| return simplePath; | ||
| } | ||
| } | ||
| #endif // __APPLE__ | ||
| return ""; | ||
| } | ||
|
|
||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -39,6 +39,9 @@ | |
| #endif | ||
|
|
||
| namespace simplecpp { | ||
|
|
||
| std::string get_apple_framework_relative_path(const std::string& header); | ||
|
|
||
|
Comment thread
Comment on lines
+43
to
+44
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityDoes this have to be public, or could you just put it into an anonymous namespace in the implementation?
Sorry, something went wrong.
All reactions
|
||
| /** C code standard */ | ||
| enum cstd_t { CUnknown=-1, C89, C99, C11, C17, C23 }; | ||
|
|
||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitytypo: candidate_paths
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.