dgnrepath.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. //
  3. //////////////////////////////////////////////////////////////////////////////
  4. //
  5. // Copyright 2015 Autodesk, Inc. All rights reserved.
  6. //
  7. // Use of this software is subject to the terms of the Autodesk license
  8. // agreement provided at the time of installation or download, or which
  9. // otherwise accompanies this software in either electronic or hard copy form.
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12. #pragma once
  13. #include "acstring.h"
  14. #include "acadstrc.h"
  15. typedef UINT64 AcDgnRefFileId;
  16. struct AcDbDgnRefFileData {
  17. enum FileType{
  18. kDgnFile = 1,
  19. kDwgFile = 2,
  20. kImageFile = 3,
  21. kOtherFile = 4
  22. };
  23. FileType type;
  24. AcString savedPathAndName;
  25. AcString foundPathAndName;
  26. AcDgnRefFileId refId;
  27. };
  28. typedef AcArray<AcDbDgnRefFileData*> AcDbRefFileDataPtrArray;
  29. typedef AcArray<AcDgnRefFileId> AcDbDgnRefFileIdArray;
  30. Acad::ErrorStatus
  31. acdbGetDgnFileReferences(const ACHAR* fileName, const ACHAR* pwd,
  32. AcDbRefFileDataPtrArray& files);
  33. class AcDbDgnRefFileRepath
  34. {
  35. public:
  36. AcDbDgnRefFileRepath() : m_fileHandle(NULL) {};
  37. Acad::ErrorStatus setFile(const AcString& dgnPathAndFilename, const ACHAR* pwd);
  38. ~AcDbDgnRefFileRepath();
  39. Acad::ErrorStatus getReferenceFilePaths(AcDbRefFileDataPtrArray& refFiles);
  40. Acad::ErrorStatus rePath(const AcDbDgnRefFileIdArray& refFileIds,
  41. const AcStringArray& newRefFileNames);
  42. private:
  43. void* m_fileHandle;
  44. };