Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
2 /*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8 #ifndef SkStream_NSData_DEFINED
9 #define SkStream_NSData_DEFINED
11 #import <UIKit/UIKit.h>
12 #include "SkStream.h"
14 /** Returns an NSData with a copy of the stream's data. The caller must call
15 retain if it intends to keep the data object beyond the current stack-frame
16 (i.e. internally we're calling [NSData dataWithBytes...]
17 */
18 NSData* NSData_dataWithStream(SkStream* stream);
20 /** Returns an NSData from the named resource (from main bundle).
21 The caller must call retain if it intends to keep the data object beyond
22 the current stack-frame
23 (i.e. internally we're calling [NSData dataWithContentsOfMappedFile...]
24 */
25 NSData* NSData_dataFromResource(const char name[], const char suffix[]);
27 /** Wrap a stream around NSData.
28 */
29 class SkStream_NSData : public SkMemoryStream {
30 public:
31 SkStream_NSData(NSData* data);
32 virtual ~SkStream_NSData();
34 static SkStream_NSData* CreateFromResource(const char name[],
35 const char suffix[]);
37 private:
38 NSData* fNSData;
39 };
41 #endif