|
ThreeWaySwitchTy | XPMP2::Read3WaySwitch (std::string &sVal, const std::string &sKey, const std::string &cfgFileName, ThreeWaySwitchTy defVal) |
| Convert strings on , auto , off to enums of type ThreeWaySwitchTy More...
|
|
int | XPMP2::PrefsFuncIntDefault (const char *, const char *, int _default) |
| Default config function just always returns the provided default value. More...
|
|
bool | XPMP2::ExistsFile (const std::string &filename) |
| Does a file path exist? More...
|
|
bool | XPMP2::IsDir (const std::string &path) |
| Is path a directory? More...
|
|
bool | XPMP2::CreateDir (const std::string &path) |
| Create directory if it does not exist. More...
|
|
bool | XPMP2::CopyFileIfNewer (const std::string &source, const std::string &destDir) |
| Copy file if source is newer or destination missing. More...
|
|
std::list< std::string > | XPMP2::GetDirContents (const std::string &path) |
| List of files in a directory (wrapper around XPLMGetDirectoryContents) More...
|
|
std::istream & | XPMP2::safeGetline (std::istream &is, std::string &t) |
| Read a line from a text file, no matter if ending on CRLF or LF. More...
|
|
const std::string & | XPMP2::GetXPSystemPath () |
| Returns XP's system directory, including a trailing slash. More...
|
|
std::string | XPMP2::StripXPSysDir (const std::string &path) |
| If a path starts with X-Plane's system directory it is stripped. More...
|
|
void | XPMP2::RemoveExtension (std::string &path) |
| Removes everything after the last dot, the dot including. More...
|
|
std::string & | XPMP2::str_tolower (std::string &s) |
| change a std::string to uppercase More...
|
|
std::vector< std::string > | XPMP2::str_tokenize (const std::string s, const std::string tokens, bool bSkipEmpty=true) |
| separates string into tokens More...
|
|
std::uint16_t | XPMP2::PJWHash16 (const char *s) |
| Produces a reproducible(!) hash value for strings. More...
|
|
float | XPMP2::headDiff (float head1, float head2) |
| (Shortest) difference between 2 angles: How much to turn to go from h1 to h2? More...
|
|
std::valarray< float > | XPMP2::HeadPitch2Vec (const float head, const float pitch) |
| Convert heading/pitch to normalized x/y/z vector. More...
|
|
std::valarray< float > | XPMP2::HeadPitchRoll2Normal (const float head, const float pitch, const float roll) |
| Convert heading/pitch/roll to unit and normal vector, ie. returns 6 values, first 3 like HeadPitch2Vec, second three the normal vector (pointing "up") More...
|
|
float | XPMP2::GetMiscNetwTime () |
| Get synched network time from X-Plane (sim/network/misc/network_time_sec) as used in Log.txt. More...
|
|
std::string | XPMP2::GetMiscNetwTimeStr (float _time=NAN) |
| Return the network time as a string like used in the XP's Log.txt. More...
|
|
const char * | XPMP2::GetGraphicsDriverTxt () |
| Text string for current graphics driver in use. More...
|
|
bool | XPMP2::IsPaused () |
| X-Plane in a Pause state? More...
|
|
bool | XPMP2::IsViewExternal () |
| Is current X-Plane view an external view (outside a cockpit)? More...
|
|
bool | XPMP2::CheckEverySoOften (float &_lastCheck, float _interval, float _now) |
| Convenience function to check on something at most every x seconds. More...
|
|
const char * | XPMP2::LogGetString (const char *szFile, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg, va_list args) |
| Returns ptr to static buffer filled with formatted log string. More...
|
|
void | XPMP2::LogMsg (const char *szFile, int ln, const char *szFunc, logLevelTy lvl, const char *szMsg,...) XPMP2_FMTARGS(5) |
| Log Text to log file. More...
|
|
Miscellaneous utility functions, including logging.
- Author
- Birger Hoppe
- Copyright
- (c) 2020 Birger Hoppe
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.