GTLRURITemplate.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. NS_ASSUME_NONNULL_BEGIN
  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 tempate 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 GTLRURITemplate : 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 my be better for some uses.
  34. + (NSString *)expandTemplate:(NSString *)URITemplate
  35. values:(NSDictionary *)valueProvider;
  36. @end
  37. NS_ASSUME_NONNULL_END