Actions
Bug / Feature #1988
closedWrong Exception-Message in "TSerializable Load<TSerializable>(string fileName)"
Start date:
15 November 2011
Due date:
12 March 2013
% Done:
100%
Estimated time:
Request Type:
Feature Request
Affected Program:
All
Affected Users:
All
Description
File: pi-vote/Common/Serialization/Serializable.cs
Function: public static TSerializable Load<TSerializable>(string fileName)
Note: This function is templated, so it should throw a customized Exception and not only a "Certificate file not found" :)
public static TSerializable Load<TSerializable>(string fileName) where TSerializable : Serializable { if (fileName == null) throw new ArgumentNullException("fileName"); if (!File.Exists(fileName)) throw new ArgumentException("Certificate file not found."); return Serializable.FromBinary<TSerializable>(File.ReadAllBytes(fileName)); }
Updated by Exception about 13 years ago
cool, jemand der sich den source ansieht. aber bleib mit bitte mit templates vom leib! der mechanismus heisst 'generics' ;)
Updated by LukyLuke about 13 years ago
template <typename T> class Response { public: Response(T answer) { std::cout << answer << std::endl; }; }; Response<std::string> resp("
Mache ich gerne, wie schon mal gesagt ;)
Und dabei habe ich schon das ein oder andere lustige Konstrukt und if-Treppchen gefunden.
Aber über Eleganz und Schönheit beim Coden lässt sich ja wunderbar streiten :)
Einen C++ und Qt Parser/Deserializer für die Zertifikate habe ich schon nachgebaut - nur noch nicht als Factory
");
Updated by Exception almost 12 years ago
- Tracker changed from 2 to Bug / Feature
- Status changed from New to Needs Work
Updated by Exception almost 12 years ago
- Category set to Usability
- Target version changed from Backlog to PiVote 1.3.2.0
- Request Type set to Feature Request
- Affected Program set to All
- Affected Users set to All
To be fixed.
Updated by Exception almost 12 years ago
- Status changed from Needs Work to Done
- % Done changed from 0 to 100
Fixed.
Updated by admin almost 12 years ago
- Assignee changed from Exception to LukyLuke
Automaticaclly enforce assigned-to to the author of the ticket
Updated by admin almost 12 years ago
- Due date set to 12 March 2013
Automatically enforce due date for Low Priority after 60 days in the future
Actions