blob: f2dc0dc83182efd9900ec8d0778f753a5ba22770 [file] [log] [blame]
Andreas Huber1aec3972016-08-26 09:26:32 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
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
Andreas Huberc9410c72016-07-28 12:18:40 -070017#ifndef STRING_TYPE_H_
18
19#define STRING_TYPE_H_
20
21#include "Type.h"
22
23namespace android {
24
25struct StringType : public Type {
26 StringType();
27
Andreas Huber881227d2016-08-02 14:20:21 -070028 std::string getCppType(StorageMode mode, std::string *extra) const override;
29
Andreas Huber2831d512016-08-15 09:33:47 -070030 std::string getJavaType() const override;
31 std::string getJavaSuffix() const override;
32
Andreas Huber881227d2016-08-02 14:20:21 -070033 void emitReaderWriter(
34 Formatter &out,
35 const std::string &name,
36 const std::string &parcelObj,
37 bool parcelObjIsPointer,
38 bool isReader,
39 ErrorMode mode) const override;
40
41 void emitReaderWriterEmbedded(
42 Formatter &out,
43 const std::string &name,
44 bool nameIsPointer,
45 const std::string &parcelObj,
46 bool parcelObjIsPointer,
47 bool isReader,
48 ErrorMode mode,
49 const std::string &parentName,
50 const std::string &offsetText) const override;
51
Andreas Huber85eabdb2016-08-25 11:24:49 -070052 void emitJavaFieldInitializer(
53 Formatter &out, const std::string &fieldName) const override;
54
55 void emitJavaFieldReaderWriter(
56 Formatter &out,
57 const std::string &blobName,
58 const std::string &fieldName,
59 const std::string &offset,
60 bool isReader) const override;
61
Andreas Huber881227d2016-08-02 14:20:21 -070062 bool needsEmbeddedReadWrite() const override;
63 bool resultNeedsDeref() const override;
Zhuoyao Zhang5158db42016-08-10 10:25:20 -070064
65 status_t emitVtsTypeDeclarations(Formatter &out) const override;
Andreas Huber85eabdb2016-08-25 11:24:49 -070066
67 void getAlignmentAndSize(size_t *align, size_t *size) const override;
Andreas Huberc9410c72016-07-28 12:18:40 -070068};
69
70} // namespace android
71
72#endif // STRING_TYPE_H_
73