Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

Utility.h 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. //
  2. // Utility.h
  3. //
  4. // Header file for utility functions for BuildDistribution.
  5. //
  6. // (C) Copyright 2010 ARM Research Labs, LLC See
  7. // www.armresearch.com for the copyright terms.
  8. //
  9. // $Id$
  10. //
  11. #include <string>
  12. #include <vector>
  13. /// Output the usage message.
  14. //
  15. // \param[in] DefaultTempPath is the default directory to build the
  16. // distribution.
  17. //
  18. void OutputUsage(std::string DefaultTempPath);
  19. /// Output the help message.
  20. void OutputHelp(void);
  21. /// Output a formatted message describing the last error from WINAPI.
  22. //
  23. // \param[in] Message is the message to output. The system error message
  24. // is output after Message.
  25. //
  26. void OutputErrorMessage(std::string Message);
  27. /// This function returns the various paths and names for building the
  28. /// distribution.
  29. //
  30. // \param[in] InputDistPath is the source path specified on the command line.
  31. //
  32. // \param[out] DistSourcePath is the source path determined from
  33. // InputDistPath.
  34. //
  35. // \param[out] DistParentPath is the parent directory of the source
  36. // directory.
  37. //
  38. // \param[out] DistName is the name of the distribution (without any ".zip"
  39. // appended.
  40. //
  41. void GetDirectoryNames(std::string &InputDistPath,
  42. std::string &DistSourcePath,
  43. std::string &DistParentPath,
  44. std::string &DistName);
  45. typedef std::vector<std::string> StringContainer; ///< Container to hold a set of strings.
  46. /// Update the files in the distribution.
  47. //
  48. // \param[in] DistPath is the name of the directory that contains the
  49. // distribution.
  50. //
  51. // \param[in] DistParentPath is the name of the parent directory of DistDir.
  52. //
  53. // \param[in] ExcludeName contains the names of the files to not
  54. // update.
  55. //
  56. // This function updates the directories in the distribution:
  57. //
  58. // 1) For each directory DIR that appears in DistDir and also
  59. // in DistParentDir:
  60. //
  61. // a) Delete the contents of DistDir/DIR, except for ExcludeName.
  62. //
  63. // b) Copy the contents of DistParentDir\DIR to DistDir\DIR, except
  64. // for ExcludeName.
  65. //
  66. void UpdateCommonDirectories(std::string DistPath,
  67. std::string DistParentPath,
  68. StringContainer ExcludeName);
  69. /// Prepare the temporary directory for the distribution.
  70. //
  71. // This function creates a temporary directory for the distribution if
  72. // it doesn't exist. If the temporary directory does exist, the
  73. // contents are removed.
  74. //
  75. // \param[in] TempPath is the path to the directory that is to contain
  76. // the distribution that will be zipped.
  77. //
  78. void PrepareTempDir(std::string TempPath);
  79. /// Copy a directory tree, except for specified files.
  80. //
  81. // \param[in] SourcePath is the directory to copy from.
  82. //
  83. // \param[in] DestPath is the directory to copy to. This directory
  84. // must exist.
  85. //
  86. // \param[in] ExcludeName contains the names of file to not copy.
  87. //
  88. void CopyDirectory(std::string SourcePath, std::string DestPath, StringContainer ExcludeName);