Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 4f068832663748acd43e7fb423bb97fe0f3fcd02 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 * Copyright (c) 2014 QNX Software Systems and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package org.eclipse.cdt.internal.qt.core.pdom;

import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.internal.core.pdom.db.Database;
import org.eclipse.core.runtime.CoreException;

@SuppressWarnings("restriction")
public class QtPDOMQmlUncreatableRegistration extends QtPDOMQmlRegistration {

	private static int offsetInitializer = QtPDOMQmlRegistration.Field.Last.offset;
	protected static enum Field {
		Reason(Database.PTR_SIZE),
		Last(0);

		public final int offset;

		private Field(int sizeof) {
			this.offset = offsetInitializer;
			offsetInitializer += sizeof;
		}
	}

	public QtPDOMQmlUncreatableRegistration(QtPDOMLinkage linkage, long record) {
		super(linkage, record);
	}

	public QtPDOMQmlUncreatableRegistration(QtPDOMLinkage linkage, QmlTypeRegistration qmlTypeReg, IASTName cppName) throws CoreException {
		super(linkage, qmlTypeReg, cppName);

		putStringOrNull(Field.Reason.offset, qmlTypeReg.getReason());
	}

	@Override
	protected int getRecordSize() {
		return Field.Last.offset;
	}

	@Override
	public int getNodeType() {
		return QtPDOMNodeType.QmlUncreatableRegistration.Type;
	}

	public String getReason() throws CoreException {
		return getStringOrNull(Field.Reason.offset);
	}
}

Back to the top