Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
915 B

  1. #pragma once
  2. class ModulesAndImports {
  3. public:
  4. ModulesAndImports();
  5. virtual ~ModulesAndImports();
  6. void SetModule (LPCSTR name);
  7. void AddImport (LPCSTR name, LPCSTR msg = "");
  8. BOOL IsModule (LPCSTR name);
  9. BOOL Lookup (LPCSTR name, CString& msg);
  10. BOOL Lookup (LPCSTR name);
  11. void Dump(std::ostream& out);
  12. private:
  13. CString m_curr_module;
  14. CMapStringToString m_imports;
  15. };
  16. inline
  17. ModulesAndImports::ModulesAndImports () :
  18. m_curr_module ("")
  19. {
  20. }
  21. inline
  22. void
  23. ModulesAndImports::SetModule (LPCSTR name)
  24. {
  25. m_curr_module = name;
  26. m_imports.SetAt (m_curr_module, "");
  27. }
  28. inline
  29. void
  30. ModulesAndImports::AddImport (LPCSTR name, LPCSTR msg)
  31. {
  32. m_imports.SetAt (m_curr_module+CString("!")+CString(name), msg);
  33. }
  34. inline
  35. BOOL
  36. ModulesAndImports::Lookup (LPCSTR name)
  37. {
  38. CString msg;
  39. return Lookup (name, msg);
  40. }