From 3948b2f5991cea328122e2e6bfce699f82c07b4d Mon Sep 17 00:00:00 2001 From: Thomas Fletcher Date: Thu, 23 Mar 2006 16:54:59 +0000 Subject: [PATCH] Restore the symbol sort class, but deprecate its use so that we can remove the code in a near release. CDT internals no longer reference this class. --- .../cdt/utils/elf/SymbolSortCompare.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/SymbolSortCompare.java diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/SymbolSortCompare.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/SymbolSortCompare.java new file mode 100644 index 00000000000..21de0c9e4bd --- /dev/null +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/SymbolSortCompare.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 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 + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.utils.elf; + + +import java.util.Comparator; + +/** + * @deprecated This class is slated for removal, it is not used by the CDT classes + */ +public class SymbolSortCompare implements Comparator { + public int compare( Object o1, Object o2 ) { + String s1 = o1.toString(); + String s2 = o2.toString(); + + while( s1.length() > 0 && s1.charAt( 0 ) == '_' ) + s1 = s1.substring( 1 ); + + while( s2.length() > 0 && s2.charAt( 0 ) == '_' ) + s2 = s2.substring( 1 ); + + return s1.compareToIgnoreCase( s2 ); + } +} +