profile.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Copyright (c) 2013-2014, Alberto Corona <alberto@0x1a.us>
  2. // All rights reserved. This file is part of yabs, distributed under the BSD
  3. // 3-Clause license. For full terms please see the LICENSE file.
  4. #ifndef _PROFILE_H
  5. #define _PROFILE_H
  6. #include <stdlib.h>
  7. #include <string>
  8. #include <vector>
  9. #define MAX_OPT 15
  10. #ifdef __unix__
  11. #endif
  12. class Profile
  13. {
  14. private:
  15. std::vector<std::string> OSList;
  16. std::vector<std::string> ArchList;
  17. std::vector<std::string> CCList;
  18. std::vector<std::string> CXXList;
  19. std::vector<std::string> ConfIncList;
  20. std::vector<std::string> LangList;
  21. std::vector<std::string> DistList;
  22. std::vector<std::string> BeforeScriptList;
  23. std::vector<std::string> AfterScriptList;
  24. std::vector<std::string> LibsList;
  25. std::vector<std::string> IncDirList;
  26. std::vector<std::string> LibDirList;
  27. std::vector<std::string> TargetList;
  28. std::vector<std::string> RemoteList;
  29. std::vector<std::string> DefinesList;
  30. int DocNum;
  31. FILE *inc_conf;
  32. const char *STDValues[MAX_OPT] = {
  33. "os", "arch", "cc", "cxx",
  34. "include", "lang", "dist", "before-script",
  35. "after-script", "libs", "incdir", "libdir",
  36. "target", "remote", "defines",
  37. };
  38. const char *temp_value;
  39. public:
  40. Profile();
  41. int AssertConfig(unsigned char *value);
  42. int CompValid(unsigned char *comp_value);
  43. int PopLists(unsigned char *list_value);
  44. int RegValues(const char *reg_value);
  45. const char *ConvValue(unsigned char *conv_value);
  46. const char *PrependLink(const char *link, const char *pre);
  47. const char *PrintProfile();
  48. void OpenInclude(const char *file);
  49. void ParseKey(const char *key);
  50. void IncDocNum();
  51. void PopValidValue(std::string &k_value, const char *v_value);
  52. void PrintList(std::vector<std::string> vect);
  53. };
  54. #endif