#pragma once #using <mscorlib.dll> #include "StdAfx.h" #include <vcclr.h> template < typename T > // T is a managed class here struct auto_dispose : gcroot< T * > // gcroot<> is an unmanaged class that wraps a pointer to a managed class { explicit auto_dispose( T * inner ) : base_type( inner ) {} ~auto_dispose() { ( *this )->Dispose(); } }; namespace p4dn { enum ErrorSeverity { Empty, Info, Warning, Failed, Fatal }; __gc public class Error : public System::IDisposable { public: Error( void ); ~Error(); void Dispose(); // : System::IDisposable::Dispose(); void Clear(); bool Test(); bool IsInfo(); bool IsWarning(); bool IsFatal(); System::String* Fmt(); __property p4dn::ErrorSeverity get_Severity() { return static_cast< p4dn::ErrorSeverity >( _err->GetSeverity() ); } private: ::Error* _err; bool _requiresFree; bool _Disposed; System::String* _Instance; void CleanUp(); public private: Error( ::Error* e ); __property ::Error* get_InternalError(); }; } // end namespace
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 5830 | Shawn Hladky | P4.Net: reorg to support release branches | ||
#3 | 5798 | Shawn Hladky |
P4.Net... still not ready for beta Added license to all files Added several doc files Misc bugs |
||
#2 | 5447 | Shawn Hladky | refactor, and added options class | ||
#1 | 5348 | Shawn Hladky | Re-organizing, for the improved API | ||
//guest/shawn_hladky/PerforceDotNet/p4dn/Error_m.h | |||||
#2 | 4545 | Shawn Hladky |
Several Fixes: Updated solution to Visual Studio 2003 Implemented InputData Implemented OutPutBinary Changed ClientAPI and Error objects to implement the IDisposable interface to improve Garbage Collection Changed header files so you don't need to add #pragma once to the p4 api headers. Refactored the ClientUserDelagate class Fixed a few minor memory leaks |
||
#1 | 4328 | Shawn Hladky | Branching from //guest/jacob_gladish/PerforceDotNet/... | ||
//guest/jacob_gladish/PerforceDotNet/p4dn/Error_m.h | |||||
#1 | 3787 | Jacob Gladish | initial code submission |