No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

StringPtr.cs

Description du code

StringPtr.cs est un fichier du projet BiblioBrol.
Ce fichier est situé dans /var/www/bin/sniplets/bibliobrol/src/.

Projet BiblioBrol :

Gestion de media en CSharp.

Pour plus d'infos, vous pouvez consulter la brève analyse.

Code source ou contenu du fichier

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Runtime.InteropServices;
  5.  
  6. namespace be.gaudry.bibliobrol.model.eid
  7. {
  8. public struct StringPtr : IDisposable
  9. {
  10. private IntPtr data;
  11. public StringPtr(string data)
  12. {
  13. // allocate
  14. this.data = (data == null) ? IntPtr.Zero :
  15. Memory.StringToHLocalUni(data);
  16. }
  17. public override string ToString()
  18. {
  19. // return
  20. return Marshal.PtrToStringUni(this.data);
  21. }
  22. public void Free()
  23. {
  24. // free
  25. Memory.FreeHLocal(this.data);
  26. }
  27. public static StringPtr Zero
  28. {
  29. get
  30. {
  31. // return empty version
  32. return new StringPtr(null);
  33. }
  34. }
  35. public static bool operator ==(StringPtr v1, StringPtr v2)
  36. {
  37. // check
  38. return v1.Equals(v2);
  39. }
  40. public static bool operator !=(StringPtr v1, StringPtr v2)
  41. {
  42. // check
  43. return !v1.Equals(v2);
  44. }
  45. public override bool Equals(object obj)
  46. {
  47. // check if it is an instance
  48. return ((obj is StringPtr) && ((StringPtr)obj).data.Equals(this.data));
  49. }
  50. public override int GetHashCode()
  51. {
  52. // return hash code of data block
  53. return data.GetHashCode();
  54. }
  55. public static void Free(StringPtr ptr)
  56. {
  57. // check if zero
  58. if (StringPtr.Zero != ptr)
  59. {
  60. // free it
  61. ptr.Free();
  62. }
  63. }
  64. public void Dispose()
  65. {
  66. // free
  67. Free();
  68. }
  69. }
  70. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/bibliobrol/src/model/eid/ 
IcôneNomTailleModification
Pas de sous-répertoires.
IcôneNomTailleModification
| _ Répertoire parent0 octets1716630787 25/05/2024 11:53:07
Fichiers contenus dans /var/www/bin/sniplets/bibliobrol/src/model/eid/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .cs|.csEidAdapter.cs27.46 Ko31/10/2018 18:32:54-refusé-
Afficher le fichier .cs|.csMemory.cs4.31 Ko31/10/2018 18:32:54-refusé-
Afficher le fichier .cs|.csBytePtr.cs3.12 Ko31/10/2018 18:32:54-refusé-
Afficher le fichier .cs|.csStringPtr.cs1.81 Ko31/10/2018 18:32:55-refusé-
Afficher le fichier .cs|.csEidPerson.cs171 octets31/10/2018 18:32:54-refusé-

Utilisation de l'explorateur de code

  • Navigation :
    • Un clic sur une icône de répertoire ouvre ce répertoire pour en afficher les fichiers.
    • Lorsque le répertoire en cours ne contient pas de sous-répertoires il est possible de remonter vers le répertoire parent.
    • La structure de répertoires en treetable (tableau en forme d'arborescence) n'est plus possibledans cette version.
    • Un clic sur une icône de fichier ouvre ce fichier pour en afficher le code avec la coloration syntaxique adaptée en fonction du langage principal utilisé dans le fichier.
  • Affichage :
    • Il est possible de trier les répertoires ou les fichiers selon certains critères (nom, taille, date).
  • Actions :
    • Les actions possible sur les fichiers dépendent de vos droits d'utilisateur sur le site. Veuillez activer le mode utilisateur pour activer les actions.

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 16/10/2009, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/cs-bibliobrol-source-rf-model/eid/StringPtr.cs.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.