Commit Graph

69 Commits (a4347bc595bef841d8bb92a49a8d7d8c6812c054)

Author SHA1 Message Date
David Hall 08273f800c Added StringHelper.IsNullOrWhiteSpace to account for missing function prior to .NET 4. (#86) 2019-12-30 10:25:45 -07:00
David Hall f74d478b28 Added support for serialization to WriteNoChecks 2019-12-10 06:55:54 -07:00
David Hall ad3e1e06ce Fixed EnumInheritance 2019-12-10 06:55:20 -07:00
David Hall 89d17b5241 Added ISerializable support as last option for pushing and pulling from memory pointers 2019-12-09 07:22:20 -07:00
David Hall 159f1c8235 Added EnumInheritance and InheritsFrom extension methods. 2019-12-06 17:09:08 -07:00
David Hall 2cb4245f37 Added IsMarshalable method and converted most uses of IsBlittable to it. Fixed MarshalToPtr(Array ... method to not throw casting exception. 2019-12-06 17:07:21 -07:00
David Hall 80b7256543 Changed unspecified size to uint.Max instead of UIntPtr.Max to prevent overflow 2019-11-25 19:32:51 -07:00
David Hall a94e60820b Reworked memory manipulation functions in InteropExtensions and IntPtrConverter to use new marshaling directives and to drive consistency of use across libs (i.e. call same method to do same work). 2019-11-19 12:52:44 -07:00
David Hall 8f289e2760 Changed to support IVanaraMarshaler requiring addition of size parameter to some methods. 2019-11-13 23:02:51 -05:00
David Hall 835487e466 Added GetOrderedFields Type extension method. 2019-10-29 10:43:18 -06:00
David Hall 05bd6d2098 Changed Write method to take structure as 'in' param. 2019-10-17 09:13:45 -06:00
David Hall 1a7aaf37f7 Fixed SetField so it works with ref structs 2019-10-07 18:42:49 -06:00
David Hall 1450d98b32 Fixed BitPosition logic for exception 2019-09-25 14:12:17 -05:00
David Hall 4322becff6 Added better documentation 2019-09-05 19:59:25 -06:00
David Hall 9d4758ed5d Added Write methods to SafeMemoryHandleExt. Added size checking from InteropExtension methods. Added offset param to ToStructure. 2019-08-21 10:18:07 -06:00
David Hall c3521b7742 MAJOR BREAKING CHANGEs:
1) Obsoleted Vanara.Extensions.InteropExtensions.StructureToPtr for a name change to MarshalToPtr for consistency.
2) Added parameter to all methods reading memory that allows developer to indicate size of allocated memory they read from.
3) Enabled the ability to read/write enum values from memory in all extension methods.
4) Added Write methods for writing to memory
2019-08-17 21:13:57 -06:00
David Hall ee72119e36 MAJOR BREAKING CHANGE: Moved all extension methods for System.Object to Vanara.Extensions.Reflection namespace to avoid Intellisense overloads with methods that will be rarely used. 2019-08-17 14:42:49 -06:00
David Hall d72cca74cb Fixed documentation error 2019-07-27 12:55:59 -06:00
David Hall 277bddcf58 Removed redundant code from CheckHasValue and used IsValid 2019-07-23 13:52:32 -06:00
David Hall 5b4853db7e Added GetStaticFieldValue method 2019-07-19 17:32:05 -06:00
David Hall ceff4504f0 Changed to BitHelper broke too much so reverted. 2019-07-16 07:43:10 -06:00
David Hall 6eb0aa354d Added ToInt64, TimeSpan.ToFileTimeStruct, and ToTimeSpan methods for FILETIME and modified ToString method so that it will display a TimeSpan value if negative. 2019-07-13 21:39:13 -06:00
David Hall 379e23ccb9 Added conversion methods To and ToEnum for fast conversions. 2019-07-13 16:27:46 -06:00
David Hall 1996fadd69 Made GetBit and GetBits extension methods 2019-07-10 11:27:04 -06:00
David Hall 025e6529de Added CreateOrDefault method to get best default value for a structure. Added InvokeStaticMethod to allow for calling a static method generically. 2019-07-09 09:23:41 -06:00
David Hall 4905441377 Added pointer value in front of string with optional params to remove. 2019-07-03 14:42:51 -06:00
David Hall 7ce7b96209 * Derived SafeCoTaskMemString from base class SafeMemString derived from SafeMemHandle<T>.
* BREAKING CHANGE: Removed CharCapacity and made Capacity show char allocation. Size (from parent) shows byte capacity. Mimics StringBuilder.
2019-06-25 17:10:57 -06:00
David Hall badc08c7e5 Extended StructureToPtr so that it works with `enum` values. 2019-06-17 13:44:46 -06:00
David Hall ea5e8d6c2b Consolidated code and fixed bug in ToFileTimeStruct that mixed up UTC conversion. 2019-06-15 13:50:10 -06:00
David Hall 1c25f88529 Added Write method to set string into memory 2019-06-07 10:58:30 -06:00
David Hall 6627c016f2 Added Get/SetFieldValue extension methods 2019-05-08 12:50:26 -06:00
David Hall f738792e11 Better null handling 2019-05-08 12:50:01 -06:00
David Hall 0ff50e3291 Added CopyTo extension that specifies a start offset. 2019-05-08 09:23:04 -06:00
David Hall 0aacc9ff30 Extension to enumerate strings from an IEnumString instance 2019-05-08 09:22:16 -06:00
David Hall 9a76ee5597 Converted MarshalingStream references to NativeMemoryStream. 2019-04-10 12:13:28 -06:00
David Hall 34d48333d6 Corrected documentation errors 2019-04-10 11:28:19 -06:00
David Hall 39264cc1ab Separated GetPropertyValue into 2 separate methods and removed type changing to prevent unintended consequences. 2019-04-09 09:16:59 -06:00
David Hall 83404805c7 Fixed so InvokeMethod would see private methods 2019-04-08 16:20:19 -06:00
David Hall a941609f2c Minor optimization of property Position use 2019-04-08 11:25:17 -06:00
David Hall 791e8af6a6 Added extension dump function for IntPtr 2019-04-08 11:24:19 -06:00
David Hall 427de28a0e Added ToStructure method with boundary checking. Cleaned and optimized code. 2019-03-26 21:03:39 -07:00
David Hall 3c40989527 Fixed Unicode bug in GetString 2019-03-25 17:40:06 -07:00
David Hall f64c2b5e6b Added FindElementType extension method for Type. 2019-03-25 17:34:43 -07:00
David Hall 43a453fef9 Fixed bug in ToStructure where mishandled IntPtr. Added length checking to ToStringEnum. Changed length param on FillMemory to 'long' to work on 64-bit systems. 2019-03-25 17:34:03 -07:00
David Hall ef2f74cd83 Added allocation size handling to GetString and AllocString 2019-03-21 09:34:36 -06:00
David Hall d7266f1919 Added ToArray and ToIEnum methods that work on Type value rather than generic type param. 2019-03-15 16:15:48 -06:00
David Hall 6a46bd4c96 Added null handler to MarshalToPtr 2019-03-13 09:56:21 -06:00
David Hall 0ede8d5738 Added MarshalObjectsToPtr method to handle object arrays. Cleaned up MarshalToPtr for string enums. 2019-03-07 09:22:04 -07:00
David Hall 3bed0225b4 Added FillMemory method for pointers 2019-01-25 11:08:18 -05:00
David Hall c8122aef53 Change obsolete use of Enum.ToString 2019-01-16 08:07:00 -07:00