/core/externals/google-toolbox-for-mac/Foundation/GTMURITemplate.h

http://macfuse.googlecode.com/ · C Header · 44 lines · 6 code · 7 blank · 31 comment · 0 complexity · 7d9781fec4170a3f9b66b284411ec5e5 MD5 · raw file

  1. /* Copyright (c) 2010 Google Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. #import <Foundation/Foundation.h>
  16. #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
  17. //
  18. // URI Template
  19. //
  20. // http://tools.ietf.org/html/draft-gregorio-uritemplate-04
  21. //
  22. // NOTE: This implemention is only a subset of the spec. It should be able
  23. // to parse any template that matches the spec, but if the template makes use
  24. // of a feature that is not supported, it will fail with an error.
  25. //
  26. @interface GTMURITemplate : NSObject
  27. // Process the template. If the template uses an unsupported feature, it will
  28. // throw an exception to help catch that limitation. Currently unsupported
  29. // feature is partial result modifiers (prefix/suffix).
  30. //
  31. // valueProvider should be anything that implements -objectForKey:. At the
  32. // simplest level, this can be an NSDictionary. However, a custom class that
  33. // implements valueForKey may be better for some uses (like if the values
  34. // are coming out of some other structure).
  35. + (NSString *)expandTemplate:(NSString *)uriTemplate values:(id)valueProvider;
  36. @end
  37. #endif // MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5