1234567891011121314151617181920212223242526 |
- #include "execpath.h"
- #include "progname.h"
- #include <util/folder/dirut.h>
- #include <util/generic/singleton.h>
- static const char* Argv0;
- namespace {
- struct TProgramNameHolder {
- inline TProgramNameHolder()
- : ProgName(GetFileNameComponent(Argv0 ? Argv0 : GetExecPath().data()))
- {
- }
- TString ProgName;
- };
- } // namespace
- const TString& GetProgramName() {
- return Singleton<TProgramNameHolder>()->ProgName;
- }
- void SetProgramName(const char* argv0) {
- Argv0 = argv0;
- }
|