Fix bug when tracefile is not aligned. Now supports exotic architectures.
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core / src / org / eclipse / linuxtools / ctf / core / event / types / StringDeclaration.java
1 /*******************************************************************************
2 * Copyright (c) 2011-2012 Ericsson, Ecole Polytechnique de Montreal and others
3 *
4 * All rights reserved. This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors: Matthew Khouzam - Initial API and implementation
10 * Contributors: Simon Marchi - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.ctf.core.event.types;
14
15 /**
16 * <b><u>StringDeclaration</u></b>
17 */
18 public class StringDeclaration implements IDeclaration {
19
20 // ------------------------------------------------------------------------
21 // Attributes
22 // ------------------------------------------------------------------------
23
24 private Encoding encoding = Encoding.UTF8;
25
26 // ------------------------------------------------------------------------
27 // Constructors
28 // ------------------------------------------------------------------------
29
30 public Encoding getEncoding() {
31 return encoding;
32 }
33
34 // ------------------------------------------------------------------------
35 // Constructors
36 // ------------------------------------------------------------------------
37
38 public StringDeclaration() {
39 }
40
41 public StringDeclaration(Encoding encoding) {
42 this.encoding = encoding;
43 }
44
45 // ------------------------------------------------------------------------
46 // Getters/Setters/Predicates
47 // ------------------------------------------------------------------------
48
49 public void setEncoding(Encoding encoding) {
50 this.encoding = encoding;
51 }
52
53 @Override
54 public long getAlignment() {
55 return 8; //FIXME: should be the elementtype.
56 }
57 // ------------------------------------------------------------------------
58 // Operations
59 // ------------------------------------------------------------------------
60
61 @Override
62 public StringDefinition createDefinition(IDefinitionScope definitionScope,
63 String fieldName) {
64 return new StringDefinition(this, definitionScope, fieldName);
65 }
66
67 @Override
68 public String toString() {
69 /* Only used for debugging */
70 return "[declaration] string[" + Integer.toHexString(hashCode()) + ']'; //$NON-NLS-1$
71 }
72
73 }
This page took 0.033688 seconds and 5 git commands to generate.