core/com.nokia.carbide.cpp.codescanner/src/com/nokia/carbide/cpp/internal/codescanner/config/CSScript.java
author stechong
Fri, 03 Apr 2009 09:33:43 -0500
branchRCL_2_0
changeset 33 2d1c891725ea
parent 2 d760517a8095
permissions -rw-r--r--
Added support for IAD rules; fix for Bug 8251.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
cawthron
parents:
diff changeset
     1
/*
cawthron
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
cawthron
parents:
diff changeset
     3
* All rights reserved.
cawthron
parents:
diff changeset
     4
* This component and the accompanying materials are made available
cawthron
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
cawthron
parents:
diff changeset
     6
* which accompanies this distribution, and is available
cawthron
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
cawthron
parents:
diff changeset
     8
*
cawthron
parents:
diff changeset
     9
* Initial Contributors:
cawthron
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
cawthron
parents:
diff changeset
    11
*
cawthron
parents:
diff changeset
    12
* Contributors:
cawthron
parents:
diff changeset
    13
*
cawthron
parents:
diff changeset
    14
* Description: 
cawthron
parents:
diff changeset
    15
*
cawthron
parents:
diff changeset
    16
*/
cawthron
parents:
diff changeset
    17
cawthron
parents:
diff changeset
    18
package com.nokia.carbide.cpp.internal.codescanner.config;
cawthron
parents:
diff changeset
    19
cawthron
parents:
diff changeset
    20
/**
cawthron
parents:
diff changeset
    21
 * Enumeration for all existing script types of CodeScanner rules.
cawthron
parents:
diff changeset
    22
 *
cawthron
parents:
diff changeset
    23
 */
cawthron
parents:
diff changeset
    24
public enum CSScript {
cawthron
parents:
diff changeset
    25
	script_accessArrayElementWithoutCheck("accessArrayElementWithoutCheck"),
cawthron
parents:
diff changeset
    26
	script_accessArrayElementWithoutCheck2("accessArrayElementWithoutCheck2"),
cawthron
parents:
diff changeset
    27
	script_activestart("activestart"),
cawthron
parents:
diff changeset
    28
	script_activestop("activestop"),
cawthron
parents:
diff changeset
    29
	script_arraypassing("arraypassing"),
cawthron
parents:
diff changeset
    30
	script_arrayptrcleanup("arrayptrcleanup"),
cawthron
parents:
diff changeset
    31
	script_assertdebuginvariant("assertdebuginvariant"),
cawthron
parents:
diff changeset
    32
	script_baddefines("baddefines"),
cawthron
parents:
diff changeset
    33
	script_baseconstruct("baseconstruct"),
cawthron
parents:
diff changeset
    34
	script_callActiveObjectWithoutCheckingOrStopping("callActiveObjectWithoutCheckingOrStopping"),
cawthron
parents:
diff changeset
    35
	script_changenotification("changenotification"),
cawthron
parents:
diff changeset
    36
	script_cleanup("cleanup"),
cawthron
parents:
diff changeset
    37
	script_commentcode("commentcode"),
cawthron
parents:
diff changeset
    38
	script_connect("connect"),
cawthron
parents:
diff changeset
    39
	script_ConnectAndDontCloseMemberVariable("ConnectAndDontCloseMemberVariable"),
cawthron
parents:
diff changeset
    40
	script_constnames("constnames"),
cawthron
parents:
diff changeset
    41
	script_consttdescptr("consttdescptr"),
cawthron
parents:
diff changeset
    42
	script_controlornull("controlornull"),
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
    43
	script_crepository("crepository"),
2
cawthron
parents:
diff changeset
    44
	script_ctltargettype("ctltargettype"),
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
    45
	script_customizableicons("customizableicons"),
2
cawthron
parents:
diff changeset
    46
	script_debugrom("debugrom"),
cawthron
parents:
diff changeset
    47
	script_declarename("declarename"),
cawthron
parents:
diff changeset
    48
	script_deleteMemberVariable("deleteMemberVariable"),
cawthron
parents:
diff changeset
    49
	script_destructor("destructor"),
cawthron
parents:
diff changeset
    50
	script_doubleSemiColon("doubleSemiColon"),
cawthron
parents:
diff changeset
    51
	script_driveletters("driveletters"),
cawthron
parents:
diff changeset
    52
	script_eikbuttons("eikbuttons"),
cawthron
parents:
diff changeset
    53
	script_eikonenvstatic("eikonenvstatic"),
cawthron
parents:
diff changeset
    54
	script_enummembers("enummembers"),
cawthron
parents:
diff changeset
    55
	script_enumnames("enumnames"),
cawthron
parents:
diff changeset
    56
	script_exportinline("exportinline"),
cawthron
parents:
diff changeset
    57
	script_exportpurevirtual("exportpurevirtual"),
33
2d1c891725ea Added support for IAD rules; fix for Bug 8251.
stechong
parents: 2
diff changeset
    58
	script_flags("flags"),
2
cawthron
parents:
diff changeset
    59
	script_foff("foff"),
cawthron
parents:
diff changeset
    60
	script_forbiddenwords("forbiddenwords"),
cawthron
parents:
diff changeset
    61
	script_forgottoputptroncleanupstack("forgottoputptroncleanupstack"),
cawthron
parents:
diff changeset
    62
	script_friend("friend"),
cawthron
parents:
diff changeset
    63
	script_goto("goto"),
cawthron
parents:
diff changeset
    64
	script_ifassignments("ifassignments"),
cawthron
parents:
diff changeset
    65
	script_ifpreprocessor("ifpreprocessor"),
cawthron
parents:
diff changeset
    66
	script_inheritanceorder("inheritanceorder"),
cawthron
parents:
diff changeset
    67
	script_intleaves("intleaves"),
cawthron
parents:
diff changeset
    68
	script_jmp("jmp"),
cawthron
parents:
diff changeset
    69
	script_leave("leave"),
cawthron
parents:
diff changeset
    70
	script_LeaveNoError("LeaveNoError"),
cawthron
parents:
diff changeset
    71
	script_leavingoperators("leavingoperators"),
cawthron
parents:
diff changeset
    72
	script_LFunctionCantLeave("LFunctionCantLeave"),
cawthron
parents:
diff changeset
    73
	script_longlines("longlines"), 
cawthron
parents:
diff changeset
    74
	script_magicnumbers("magicnumbers"),
cawthron
parents:
diff changeset
    75
	script_mclassdestructor("mclassdestructor"),
cawthron
parents:
diff changeset
    76
	script_memberlc("memberlc"),
cawthron
parents:
diff changeset
    77
	script_membervariablecallld("membervariablecallld"),
cawthron
parents:
diff changeset
    78
	script_missingcancel("missingcancel"),
cawthron
parents:
diff changeset
    79
	script_missingcclass("missingcclass"),
cawthron
parents:
diff changeset
    80
	script_mmpsourcepath("mmpsourcepath"),
cawthron
parents:
diff changeset
    81
	script_multilangrsc("multilangrsc"),
cawthron
parents:
diff changeset
    82
	script_multipledeclarations("multipledeclarations"),
cawthron
parents:
diff changeset
    83
	script_multipleinheritance("multipleinheritance"),
cawthron
parents:
diff changeset
    84
	script_mydocs("mydocs"),
cawthron
parents:
diff changeset
    85
	script_namespace("namespace"),
cawthron
parents:
diff changeset
    86
	script_newlreferences("newlreferences"),
cawthron
parents:
diff changeset
    87
	script_noleavetrap("noleavetrap"),
cawthron
parents:
diff changeset
    88
	script_nonconsthbufc("nonconsthbufc"),
cawthron
parents:
diff changeset
    89
	script_nonconsttdesc("nonconsttdesc"),
cawthron
parents:
diff changeset
    90
	script_nonleavenew("nonleavenew"),
cawthron
parents:
diff changeset
    91
	script_nonunicodeskins("nonunicodeskins"),
cawthron
parents:
diff changeset
    92
	script_null("null"),
cawthron
parents:
diff changeset
    93
	script_open("open"),
cawthron
parents:
diff changeset
    94
	script_pointertoarrays("pointertoarrays"),
cawthron
parents:
diff changeset
    95
	script_pragmadisable("pragmadisable"),
cawthron
parents:
diff changeset
    96
	script_pragmamessage("pragmamessage"),
cawthron
parents:
diff changeset
    97
	script_pragmaother("pragmaother"),
cawthron
parents:
diff changeset
    98
	script_privateinheritance("privateinheritance"),
cawthron
parents:
diff changeset
    99
	script_pushaddrvar("pushaddrvar"),
cawthron
parents:
diff changeset
   100
	script_pushmember("pushmember"),
cawthron
parents:
diff changeset
   101
	script_readresource("readresource"),
cawthron
parents:
diff changeset
   102
	script_resourcenotoncleanupstack("resourcenotoncleanupstack"),
cawthron
parents:
diff changeset
   103
	script_resourcesonheap("resourcesonheap"),
cawthron
parents:
diff changeset
   104
	script_returndescriptoroutofscope("returndescriptoroutofscope"),
cawthron
parents:
diff changeset
   105
	script_rfs("rfs"),
cawthron
parents:
diff changeset
   106
	script_rssnames("rssnames"),
cawthron
parents:
diff changeset
   107
	script_stringliterals("stringliterals"),
cawthron
parents:
diff changeset
   108
	script_stringsinresourcefiles("stringsinresourcefiles"),
cawthron
parents:
diff changeset
   109
	script_struct("struct"),
cawthron
parents:
diff changeset
   110
	script_tcclasses("tcclasses"),
cawthron
parents:
diff changeset
   111
	script_tclassdestructor("tclassdestructor"),
cawthron
parents:
diff changeset
   112
	script_todocomments("todocomments"),
cawthron
parents:
diff changeset
   113
	script_trapcleanup("trapcleanup"),
cawthron
parents:
diff changeset
   114
	script_trapeleave("trapeleave"),
cawthron
parents:
diff changeset
   115
	script_traprunl("traprunl"),
cawthron
parents:
diff changeset
   116
	script_trspassing("trspassing"),
cawthron
parents:
diff changeset
   117
	script_uids("uids"),
cawthron
parents:
diff changeset
   118
	script_uncompressedaif("uncompressedaif"),
cawthron
parents:
diff changeset
   119
	script_uncompressedbmp("uncompressedbmp"),
cawthron
parents:
diff changeset
   120
	script_unicodesource("unicodesource"),
cawthron
parents:
diff changeset
   121
	script_userafter("userafter"),
cawthron
parents:
diff changeset
   122
	script_userfree("userfree"),
cawthron
parents:
diff changeset
   123
	script_userWaitForRequest("userWaitForRequest"),
cawthron
parents:
diff changeset
   124
	script_variablenames("variablenames"),
cawthron
parents:
diff changeset
   125
	script_voidparameter("voidparameter"),
cawthron
parents:
diff changeset
   126
	script_worryingcomments("worryingcomments"),
cawthron
parents:
diff changeset
   127
	script_unknown("unknown");
cawthron
parents:
diff changeset
   128
	
cawthron
parents:
diff changeset
   129
	private String name;
cawthron
parents:
diff changeset
   130
	
cawthron
parents:
diff changeset
   131
	/**
cawthron
parents:
diff changeset
   132
	 * Constructor
cawthron
parents:
diff changeset
   133
	 */
cawthron
parents:
diff changeset
   134
	CSScript(String str) {
cawthron
parents:
diff changeset
   135
		name = str;
cawthron
parents:
diff changeset
   136
	}
cawthron
parents:
diff changeset
   137
	
cawthron
parents:
diff changeset
   138
	/**
cawthron
parents:
diff changeset
   139
	 * Return the name of a CSSCript enum constant.
cawthron
parents:
diff changeset
   140
	 */
cawthron
parents:
diff changeset
   141
	public String toString() {
cawthron
parents:
diff changeset
   142
		return name;
cawthron
parents:
diff changeset
   143
	}
cawthron
parents:
diff changeset
   144
cawthron
parents:
diff changeset
   145
	/**
cawthron
parents:
diff changeset
   146
	 * Return the CSScript enum constant with the specified name.
cawthron
parents:
diff changeset
   147
	 * @param name - name of the constant to return
cawthron
parents:
diff changeset
   148
	 * @return the CSScript enum constant with the specified name
cawthron
parents:
diff changeset
   149
	 */
cawthron
parents:
diff changeset
   150
	public static CSScript toScript(String name) {
cawthron
parents:
diff changeset
   151
        try {
cawthron
parents:
diff changeset
   152
            return valueOf(name);
cawthron
parents:
diff changeset
   153
        } 
cawthron
parents:
diff changeset
   154
        catch (Exception e) {
cawthron
parents:
diff changeset
   155
            return script_unknown;
cawthron
parents:
diff changeset
   156
        }
cawthron
parents:
diff changeset
   157
	}
cawthron
parents:
diff changeset
   158
cawthron
parents:
diff changeset
   159
}