daeRawResolver.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright 2006 Sony Computer Entertainment Inc.
  3. *
  4. * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this
  5. * file except in compliance with the License. You may obtain a copy of the License at:
  6. * http://research.scea.com/scea_shared_source_license.html
  7. *
  8. * Unless required by applicable law or agreed to in writing, software distributed under the License
  9. * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  10. * implied. See the License for the specific language governing permissions and limitations under the
  11. * License.
  12. */
  13. #ifndef __DAE_RAWRESOLVER_H__
  14. #define __DAE_RAWRESOLVER_H__
  15. #include <string>
  16. #include <map>
  17. #include <dae/daeURI.h>
  18. class DAE;
  19. /**
  20. * The @c daeRawResolver class derives from @c daeURIResolver and implements
  21. * the .raw backend resolver for raw binary data.
  22. */
  23. class DLLSPEC daeRawResolver : public daeURIResolver
  24. {
  25. public:
  26. /**
  27. * Constructor.
  28. */
  29. daeRawResolver(DAE& dae);
  30. /**
  31. * Destructor.
  32. */
  33. ~daeRawResolver();
  34. public: // Abstract Interface
  35. virtual daeElement* resolveElement(const daeURI& uri);
  36. virtual daeString getName();
  37. };
  38. // A simple class to make speed up the process of resolving a .raw URI.
  39. // The result of the resolve is cached for future use.
  40. // This is meant for DOM internal use only.
  41. class DLLSPEC daeRawRefCache {
  42. public:
  43. daeElement* lookup(const daeURI& uri);
  44. void add(const daeURI& uri, daeElement* elt);
  45. void remove(const daeURI& uri);
  46. void clear();
  47. private:
  48. std::map<std::string, daeElement*> lookupTable;
  49. };
  50. #endif