@@ -249,7 +249,7 @@ public ValueNode(string text, Value value)
249
249
m_Value = value ;
250
250
}
251
251
252
- private string Escape ( string text )
252
+ internal static string Escape ( string text )
253
253
{
254
254
text = text . Replace ( "\\ " , "\\ \\ " ) ;
255
255
text = text . Replace ( "\" " , "\\ \" " ) ;
@@ -266,12 +266,28 @@ private string Escape(string text)
266
266
return text ;
267
267
}
268
268
269
- private string CleanTypeClassPaths ( string qualifiedName )
269
+ /// <summary>
270
+ /// Removes the class path from a fully qualified name. Eg.: flash.display::Sprite becomes Sprite
271
+ /// </summary>
272
+ /// <param name="qualifiedName">The fully qualified name to clean</param>
273
+ /// <returns>The class name with no class path</returns>
274
+ internal static string CleanTypeClassPaths ( string qualifiedName )
270
275
{
271
276
char [ ] delims = { ',' , ' ' , '<' , '>' } ;
272
277
var buffer = new StringBuilder ( ) ;
273
278
bool inPackage = false ;
274
279
280
+ /**
281
+ In order to strip the class-path we are going to traverse the class type in
282
+ reverse so we don't need to keep extra buffers or use complex splitting or regexes.
283
+ Packages are always separated by colons or dots, so the first time we found one we
284
+ are on the package (watch out with Vector.<> notation), and the whole type is always
285
+ together, so any delim means that we finished with the type, and since this comes
286
+ from the debugger we know that we are not going to find any other type delimiter,
287
+ or incomplete/wrong case. We could check for Char.IsWhiteSpace for other uses.
288
+ In resume, with this method we could support without much problem even complex cases like:
289
+ Collections.Generic.Dictionary<Collections.Generic.Dictionary<String, Test.CustomClassKey>, Collections.Generic.List<Test.CustomClass>>
290
+ */
275
291
for ( int i = qualifiedName . Length - 1 ; i >= 0 ; i -- )
276
292
{
277
293
char c = qualifiedName [ i ] ;
0 commit comments