|
||||
File indexing completed on 2025-01-30 09:31:43
0001 // 0002 // Copyright 2019 The Abseil Authors. 0003 // 0004 // Licensed under the Apache License, Version 2.0 (the "License"); 0005 // you may not use this file except in compliance with the License. 0006 // You may obtain a copy of the License at 0007 // 0008 // https://www.apache.org/licenses/LICENSE-2.0 0009 // 0010 // Unless required by applicable law or agreed to in writing, software 0011 // distributed under the License is distributed on an "AS IS" BASIS, 0012 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0013 // See the License for the specific language governing permissions and 0014 // limitations under the License. 0015 0016 #ifndef ABSL_FLAGS_INTERNAL_PROGRAM_NAME_H_ 0017 #define ABSL_FLAGS_INTERNAL_PROGRAM_NAME_H_ 0018 0019 #include <string> 0020 0021 #include "absl/base/config.h" 0022 #include "absl/strings/string_view.h" 0023 0024 // -------------------------------------------------------------------- 0025 // Program name 0026 0027 namespace absl { 0028 ABSL_NAMESPACE_BEGIN 0029 namespace flags_internal { 0030 0031 // Returns program invocation name or "UNKNOWN" if `SetProgramInvocationName()` 0032 // is never called. At the moment this is always set to argv[0] as part of 0033 // library initialization. 0034 std::string ProgramInvocationName(); 0035 0036 // Returns base name for program invocation name. For example, if 0037 // ProgramInvocationName() == "a/b/mybinary" 0038 // then 0039 // ShortProgramInvocationName() == "mybinary" 0040 std::string ShortProgramInvocationName(); 0041 0042 // Sets program invocation name to a new value. Should only be called once 0043 // during program initialization, before any threads are spawned. 0044 void SetProgramInvocationName(absl::string_view prog_name_str); 0045 0046 } // namespace flags_internal 0047 ABSL_NAMESPACE_END 0048 } // namespace absl 0049 0050 #endif // ABSL_FLAGS_INTERNAL_PROGRAM_NAME_H_
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |