1 /* 2 * Copyright 2005-2018, Haiku, Inc. All rights reserved. 3 * Copyright 2005, Ingo Weinhold, <bonefish@users.sf.net> 4 * 5 * Distributed under the terms of the MIT License. 6 * 7 * Authors: 8 * Jeremiah Bailey, <jjbailey@gmail.com> 9 * Ingo Weinhold, <bonefish@users.sf.net> 10 */ 11 12 13 #ifndef ARGUMENTS_H 14 #define ARGUMENTS_H 15 16 #include <Rect.h> 17 18 class Arguments { 19 public: 20 Arguments(int defaultArgcNum, const char* const* defaultArgv); 21 ~Arguments(); 22 23 void Parse(int argc, const char* const* argv); 24 Bounds()25 BRect Bounds() const { return fBounds; } Title()26 const char* Title() const { return fTitle; } WorkingDir()27 const char* WorkingDir() const { return fWorkingDirectory; } StandardShell()28 bool StandardShell() const { return fStandardShell; } FullScreen()29 bool FullScreen() const { return fFullScreen; } UsageRequested()30 bool UsageRequested() const { return fUsageRequested; } 31 void GetShellArguments(int& argc, const char* const*& argv) const; 32 33 private: 34 void _SetShellArguments(int argc, const char* const* argv); 35 36 bool fUsageRequested; 37 BRect fBounds; 38 bool fStandardShell; 39 bool fFullScreen; 40 int fShellArgumentCount; 41 const char** fShellArguments; 42 const char* fTitle; 43 const char* fWorkingDirectory; 44 }; 45 46 47 #endif // ARGUMENTS_H 48