sourcecodeline.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #ifndef __SOURCECODELINE_H
  2. #define __SOURCECODELINE_H
  3. #include <bfc/dispatch.h>
  4. #include <bfc/string/StringW.h>
  5. class SourceCodeLine : public Dispatchable {
  6. public:
  7. const wchar_t *getLine();
  8. void setLine(const wchar_t *line);
  9. int getPointer();
  10. void setPointer(int pointer);
  11. int getLength();
  12. void setLength(int length);
  13. void setSourceFile(const wchar_t *file);
  14. const wchar_t *getSourceFile();
  15. void setSourceFileLine(int linenumber);
  16. int getSourceFileLine();
  17. enum {
  18. SOURCECODELINE_GETLINE = 0,
  19. SOURCECODELINE_SETLINE = 10,
  20. SOURCECODELINE_GETPOINTER = 20,
  21. SOURCECODELINE_SETPOINTER = 30,
  22. SOURCECODELINE_GETLENGTH = 40,
  23. SOURCECODELINE_SETLENGTH = 50,
  24. SOURCECODELINE_SETSOURCEFILE = 60,
  25. SOURCECODELINE_GETSOURCEFILE = 70,
  26. SOURCECODELINE_SETSOURCEFILELINE = 80,
  27. SOURCECODELINE_GETSOURCEFILELINE = 90,
  28. };
  29. };
  30. inline const wchar_t *SourceCodeLine::getLine() {
  31. return _call(SOURCECODELINE_GETLINE, (const wchar_t*)NULL);
  32. }
  33. inline void SourceCodeLine::setLine(const wchar_t *line) {
  34. _voidcall(SOURCECODELINE_SETLINE, line);
  35. }
  36. inline int SourceCodeLine::getPointer() {
  37. return _call(SOURCECODELINE_GETPOINTER, (int)0);
  38. }
  39. inline void SourceCodeLine::setPointer(int pointer) {
  40. _voidcall(SOURCECODELINE_SETPOINTER, pointer);
  41. }
  42. inline int SourceCodeLine::getLength() {
  43. return _call(SOURCECODELINE_GETLENGTH, (int)0);
  44. }
  45. inline void SourceCodeLine::setLength(int length) {
  46. _voidcall(SOURCECODELINE_SETLENGTH, length);
  47. }
  48. inline void SourceCodeLine::setSourceFile(const wchar_t *file) {
  49. _voidcall(SOURCECODELINE_SETSOURCEFILE, file);
  50. }
  51. inline const wchar_t *SourceCodeLine::getSourceFile() {
  52. return _call(SOURCECODELINE_GETSOURCEFILE, (const wchar_t *)0);
  53. }
  54. inline void SourceCodeLine::setSourceFileLine(int linenumber) {
  55. _voidcall(SOURCECODELINE_SETSOURCEFILELINE, linenumber);
  56. }
  57. inline int SourceCodeLine::getSourceFileLine() {
  58. return _call(SOURCECODELINE_GETSOURCEFILELINE, (int)0);
  59. }
  60. class SourceCodeLineI : public SourceCodeLine {
  61. public:
  62. SourceCodeLineI();
  63. virtual ~SourceCodeLineI();
  64. virtual const wchar_t *getLine();
  65. virtual void setLine(const wchar_t *line);
  66. virtual int getPointer();
  67. virtual void setPointer(int pointer);
  68. virtual int getLength();
  69. virtual void setLength(int length);
  70. virtual void setSourceFile(const wchar_t *file);
  71. virtual const wchar_t *getSourceFile();
  72. virtual void setSourceFileLine(int linenumber);
  73. virtual int getSourceFileLine();
  74. protected:
  75. RECVS_DISPATCH;
  76. StringW line;
  77. StringW file;
  78. int fileline;
  79. int pointer;
  80. int length;
  81. };
  82. #endif