HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_Asset.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Side Effects Software Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * NAME: HUSD_Asset.h (HUSD Library, C++)
17  *
18  * COMMENTS:
19  * Wrapper around the ArResolver and ArAsset classes.
20  * Assets use the form path/to/zip[filename.ext]
21  */
22 #ifndef HUSD_Asset_h
23 #define HUSD_Asset_h
24 
25 #include "HUSD_API.h"
26 #include <UT/UT_UniquePtr.h>
27 #include <SYS/SYS_Types.h>
28 #include <utility>
29 
30 class UT_StringRef;
31 class UT_IStream;
32 class husd_AssetPrivate;
33 
35 {
36 public:
37  HUSD_Asset(const UT_StringRef &asset_path);
38  ~HUSD_Asset();
39 
40 
41  bool isValid() const { return myValid; }
42 
43  // Return a new stream for this asset.
44  UT_IStream *newStream();
45 
46  // Size in bytes.
47  size_t size() const;
48 
49 private:
50  bool myValid;
51  husd_AssetPrivate *myData;
52  std::shared_ptr<const char> myStreamBuffer;
53 };
54 
55 #endif
#define HUSD_API
Definition: HUSD_API.h:32
bool isValid() const
Definition: HUSD_Asset.h:41
GLsizeiptr size
Definition: glcorearb.h:664