StackTrace.h 884 B

1234567891011121314151617181920212223
  1. #ifndef __STACKTRACE_H
  2. #define __STACKTRACE_H
  3. class StackTrace
  4. {
  5. public:
  6. static const int CALL_STACK_SIZE = 200;
  7. const char *FileNames[CALL_STACK_SIZE];
  8. const char *FunctionNames[CALL_STACK_SIZE];
  9. int SavedLineNumbers[CALL_STACK_SIZE];
  10. int LineNumberStack;
  11. void DisplayErrorMessage(int val);
  12. void DisplayErrorMessage(const char *message,int message_length);
  13. int ToString(char *output_buffer,int max_buffer_length);
  14. private:
  15. static void AppendString(const char *input,int input_length,char *output_buffer,int max_buffer_length,int &bytes_in_buffer);
  16. static void AppendString(const char *input,char *output_buffer,int max_buffer_length,int &bytes_in_buffer);
  17. static int Itoa(int value,char *buffer); // Convert an int to a string. Return the string length.
  18. static const char *basename(const char *filename); // Returns the file name without directory info.
  19. };
  20. #endif