tracefw/tracecompiler/src/com.nokia.tracecompiler/src/com/nokia/tracecompiler/decodeplugins/dictionary/encoder/LocationStore.java
branchRCL_3
changeset 20 ca8a1b6995f6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tracefw/tracecompiler/src/com.nokia.tracecompiler/src/com/nokia/tracecompiler/decodeplugins/dictionary/encoder/LocationStore.java	Tue Aug 31 16:45:49 2010 +0300
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+* Location store
+*
+*/
+package com.nokia.tracecompiler.decodeplugins.dictionary.encoder;
+
+/**
+ * Location store
+ * 
+ */
+public class LocationStore {
+
+	/**
+	 * Writes <locations>
+	 */
+	public static void startLocations() {
+		TagWriter.write(TagWriter.LOCATIONS_START, TagWriter.INDENT_1);
+	}
+
+	/**
+	 * Starts <path val=""> structure
+	 * 
+	 * @param path
+	 *            relative or absolute path to some directory
+	 */
+	public static void startPath(String path) {
+		StringBuffer sb = new StringBuffer();
+		sb.append(TagWriter.PATH_START_OPEN);
+		TagWriter.appendAttribute(sb, TagWriter.VAL_ATTR, path, false);
+		sb.append(TagWriter.TAG_CLOSE);
+		TagWriter.write(sb.toString(), TagWriter.INDENT_2);
+	}
+
+	/**
+	 * Writes <file id="">fileName</file> structure
+	 * 
+	 * @param id
+	 *            unique number within <locations> structure
+	 * @param fileName
+	 *            value of the file element
+	 */
+	public static void writeFile(int id, String fileName) {
+		StringBuffer sb = new StringBuffer();
+		sb.append(TagWriter.FILE_START_OPEN);
+		TagWriter.appendAttribute(sb, TagWriter.ID_ATTR, String.valueOf(id),
+				false);
+		sb.append(TagWriter.TAG_CLOSE);
+		sb.append(XMLDataFilter.changeData(fileName));
+		sb.append(TagWriter.FILE_END);
+		TagWriter.write(sb.toString(), TagWriter.INDENT_3);
+	}
+
+	/**
+	 * Writes </path>
+	 */
+	public static void endPath() {
+		TagWriter.write(TagWriter.PATH_END, TagWriter.INDENT_2);
+	}
+
+	/**
+	 * Writes </locations>
+	 */
+	public static void endLocations() {
+		TagWriter.write(TagWriter.LOCATIONS_END, TagWriter.INDENT_1);
+	}
+
+}