|
|
|
|||||
|
problem in mapping string->string[] in C#
Hi guys,
I tried to generate a C# dictionaryBase impl which names stringArrayMap that maps string->string[], however, the generated code couldn't be compiled: ----- public override bool Equals(object other) { if(object.ReferenceEquals(this, other)) { return true; } if(!(other is StringArrayMap)) { return false; } if(Count != ((StringArrayMap)other).Count) { return false; } string[] __klhs = new string[Count]; Keys.CopyTo(__klhs, 0); _System.Array.Sort(__klhs); string[] __krhs = new string[((StringArrayMap)other).Count]; ((StringArrayMap)other).Keys.CopyTo(__krhs, 0); _System.Array.Sort(__krhs); for(int i = 0; i < Count; ++i) { if(!__klhs[i].Equals(__krhs[i])) { return false; } } string[][] __vlhs = new string[][Count]; Values.CopyTo(__vlhs, 0); _System.Array.Sort(__vlhs); string[][] __vrhs = new string[][((StringArrayMap)other).Count]; ((StringArrayMap)other).Values.CopyTo(__vrhs, 0); _System.Array.Sort(__vrhs); for(int i = 0; i < Count; ++i) { if(__vlhs[i] == null && __vrhs[i] != null) { return false; } if(!__vlhs[i].Equals(__vrhs[i])) { return false; } } return true; } ----- the problem lies in: string[][] __vlhs = new string[][Count]; do I have to turn to string->collection to get around that? Thanks! Tea |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to realize string to object in ice? | rellik78 | Help Center | 1 | 09-20-2006 08:07 AM |
| std::string in interface | dthompson | Help Center | 1 | 06-21-2006 05:49 PM |
| Casting char* to std::string | inmmat | Help Center | 5 | 06-10-2006 02:43 PM |
| Link problem using a string to class map | MKoleoso | Help Center | 2 | 07-03-2005 12:02 PM |
| problem with string sequences | alexs | Bug Reports | 4 | 01-27-2004 11:28 AM |