Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: trunk/include/core/SkStream.h

Issue 12919013: move SK_MMAP_SUPPORT into SkPreConfig, so we can know about its availability (Closed) Base URL: http://skia.googlecode.com/svn/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/include/core/SkPreConfig.h ('k') | trunk/src/core/SkData.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkStream_DEFINED 10 #ifndef SkStream_DEFINED
11 #define SkStream_DEFINED 11 #define SkStream_DEFINED
12 12
13 #include "SkRefCnt.h" 13 #include "SkRefCnt.h"
14 #include "SkScalar.h" 14 #include "SkScalar.h"
15 15
16 class SkData; 16 class SkData;
17 17
18 class SK_API SkStream : public SkRefCnt { 18 class SK_API SkStream : public SkRefCnt {
19 public: 19 public:
20 /**
21 * Attempts to open the specified file, and return a stream to it (using
22 * mmap if available). On success, the caller must call unref() on the
23 * returned object. On failure, returns NULL.
24 */
25 static SkStream* NewFromFile(const char path[]);
26
20 SK_DECLARE_INST_COUNT(SkStream) 27 SK_DECLARE_INST_COUNT(SkStream)
21 28
22 /** Called to rewind to the beginning of the stream. If this cannot be 29 /** Called to rewind to the beginning of the stream. If this cannot be
23 done, return false. 30 done, return false.
24 */ 31 */
25 virtual bool rewind() = 0; 32 virtual bool rewind() = 0;
26 /** If this stream represents a file, this method returns the file's name. 33 /** If this stream represents a file, this method returns the file's name.
27 If it does not, it returns NULL (the default behavior). 34 If it does not, it returns NULL (the default behavior).
28 */ 35 */
29 virtual const char* getFileName(); 36 virtual const char* getFileName();
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 virtual void newline() SK_OVERRIDE; 380 virtual void newline() SK_OVERRIDE;
374 381
375 private: 382 private:
376 typedef SkWStream INHERITED; 383 typedef SkWStream INHERITED;
377 }; 384 };
378 385
379 // for now 386 // for now
380 typedef SkFILEStream SkURLStream; 387 typedef SkFILEStream SkURLStream;
381 388
382 #endif 389 #endif
OLDNEW
« no previous file with comments | « trunk/include/core/SkPreConfig.h ('k') | trunk/src/core/SkData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698