MediaInfo.hpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #if !defined(MEDIAINFO_HPP)
  2. #define MEDIAINFO_HPP
  3. //______________________________________________________________________________
  4. //
  5. // MediaInfo.hpp
  6. //
  7. #include "FourCC.hpp"
  8. #include <string>
  9. #include <exception>
  10. #include <iosfwd>
  11. namespace on2vp
  12. {
  13. //--------------------------------------
  14. class MediaInfo
  15. {
  16. friend std::ostream& operator<<(std::ostream& os, const MediaInfo& mi);
  17. public:
  18. class Exception : public std::exception
  19. {
  20. public:
  21. Exception(const std::string& strText);
  22. ~Exception() throw();
  23. const char* what() const throw();
  24. private:
  25. std::string m_strText;
  26. };
  27. MediaInfo();
  28. MediaInfo(const MediaInfo& mi);
  29. ~MediaInfo();
  30. MediaInfo& operator=(const MediaInfo& mi);
  31. void parse(const std::string& strMediaInfo);
  32. const unsigned char* data() const;
  33. unsigned long dataSize() const;
  34. private:
  35. enum
  36. {
  37. DataSizeMax = 16384
  38. };
  39. void init_();
  40. void copy_(const MediaInfo& mi);
  41. void extract_(const std::string& strMediaInfo);
  42. void update_();
  43. unsigned long append_(FourCC fcc, const std::string& strData, char*& pData);
  44. std::string m_strArchivalLocation;
  45. std::string m_strArtist;
  46. std::string m_strCommissioned;
  47. std::string m_strComments;
  48. std::string m_strCopyright;
  49. std::string m_strCreationDate;
  50. std::string m_strCropped;
  51. std::string m_strDimensions;
  52. std::string m_strDotsPerInch;
  53. std::string m_strEngineer;
  54. std::string m_strGenre;
  55. std::string m_strKeywords;
  56. std::string m_strLightness;
  57. std::string m_strMedium;
  58. std::string m_strName;
  59. std::string m_strPaletteSetting;
  60. std::string m_strProduct;
  61. std::string m_strSubject;
  62. std::string m_strSoftware;
  63. std::string m_strSharpness;
  64. std::string m_strSource;
  65. std::string m_strSourceForm;
  66. std::string m_strTechnician;
  67. unsigned char* m_pData;
  68. unsigned long m_ulDataSize;
  69. };
  70. } // namespace on2vp
  71. #endif // MEDIAINFO_HPP