Skip to content
New issue

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

Implementation of Path::self() #4319

Merged
merged 4 commits into from
Dec 5, 2023
Merged

Implementation of Path::self() #4319

merged 4 commits into from
Dec 5, 2023

Conversation

matejk
Copy link
Contributor

@matejk matejk commented Dec 4, 2023

This PR contains content of PR #3758 by @JackyWoo with minor additional changes.

Resolves #2282.

Foundation/src/Path_UNIX.cpp Show resolved Hide resolved
Foundation/testsuite/src/PathTest.cpp Outdated Show resolved Hide resolved
@matejk
Copy link
Contributor Author

matejk commented Dec 4, 2023

@aleks-f , it is very unlikely that the functions to get current program name would fail, however: shall an exception be thrown in that case?


assertTrue(!self.empty());
Path p(self);

assertTrue(p.isAbsolute());
assertTrue(p.isFile());
assertTrue(self.find("testrunner") != std::string::npos);

#else
std::cout "Path::self() not implemented for this platform."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing <<

@aleks-f
Copy link
Member

aleks-f commented Dec 4, 2023

@aleks-f , it is very unlikely that the functions to get current program name would fail, however: shall an exception be thrown in that case?

yes, throw something appropriate

@aleks-f aleks-f mentioned this pull request Dec 4, 2023
@matejk matejk merged commit 607b086 into devel Dec 5, 2023
18 checks passed
@matejk matejk deleted the 2282-path-self branch December 5, 2023 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Path::self()
2 participants