]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/VfrCompile/VfrUtilityLib.h
BaseTools/VfrCompile: Add assignment operator definition for some classes
[mirror_edk2.git] / BaseTools / Source / C / VfrCompile / VfrUtilityLib.h
index c8f5333641bb6607d59c81d9aa39c7a010fca106..2e06e4f1672ce1925e47f4775c00b8b6cce24055 100644 (file)
@@ -2,7 +2,7 @@
   \r
   Vfr common library functions.\r
 \r
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -33,6 +33,8 @@ extern BOOLEAN  VfrCompatibleMode;
 #define EFI_BITS_PER_UINT32                (1 << EFI_BITS_SHIFT_PER_UINT32)\r
 \r
 #define BUFFER_SAFE_FREE(Buf)              do { if ((Buf) != NULL) { delete (Buf); } } while (0);\r
+#define ARRAY_SAFE_FREE(Buf)               do { if ((Buf) != NULL) { delete[] (Buf); } } while (0);\r
+\r
 \r
 class CVfrBinaryOutput {\r
 public:\r
@@ -139,7 +141,7 @@ struct SVfrPackStackNode {
 \r
   ~SVfrPackStackNode (VOID) {\r
     if (mIdentifier != NULL) {\r
-      delete mIdentifier;\r
+      delete[] mIdentifier;\r
     }\r
     mNext = NULL;\r
   }\r
@@ -262,9 +264,18 @@ struct EFI_VARSTORE_INFO {
 \r
   EFI_VARSTORE_INFO (VOID);\r
   EFI_VARSTORE_INFO (IN EFI_VARSTORE_INFO &);\r
+  EFI_VARSTORE_INFO& operator=(IN CONST EFI_VARSTORE_INFO &);\r
   BOOLEAN operator == (IN EFI_VARSTORE_INFO *);\r
 };\r
 \r
+struct BufferVarStoreFieldInfoNode {\r
+  EFI_VARSTORE_INFO  mVarStoreInfo;\r
+  struct BufferVarStoreFieldInfoNode *mNext;\r
+\r
+  BufferVarStoreFieldInfoNode( IN EFI_VARSTORE_INFO  *Info );\r
+  ~BufferVarStoreFieldInfoNode ();\r
+};\r
+\r
 #define EFI_VARSTORE_ID_MAX              0xFFFF\r
 #define EFI_FREE_VARSTORE_ID_BITMAP_SIZE ((EFI_VARSTORE_ID_MAX + 1) / EFI_BITS_PER_UINT32)\r
 \r
@@ -278,6 +289,8 @@ private:
 \r
   struct SVfrVarStorageNode *mCurrVarStorageNode;\r
   struct SVfrVarStorageNode *mNewVarStorageNode;\r
+  BufferVarStoreFieldInfoNode    *mBufferFieldInfoListHead;\r
+  BufferVarStoreFieldInfoNode    *mBufferFieldInfoListTail;\r
 \r
 private:\r
 \r
@@ -317,8 +330,12 @@ public:
   EFI_VFR_RETURN_CODE GetBufferVarStoreDataTypeName (IN EFI_VARSTORE_ID, OUT CHAR8 **);\r
   EFI_VFR_RETURN_CODE GetEfiVarStoreInfo (IN EFI_VARSTORE_INFO *);\r
   EFI_VFR_RETURN_CODE GetNameVarStoreInfo (IN EFI_VARSTORE_INFO *, IN UINT32);\r
+  EFI_VFR_RETURN_CODE AddBufferVarStoreFieldInfo (IN EFI_VARSTORE_INFO *);\r
+  EFI_VFR_RETURN_CODE GetBufferVarStoreFieldInfo (IN OUT EFI_VARSTORE_INFO *);\r
 };\r
 \r
+extern CVfrDataStorage gCVfrDataStorage;\r
+\r
 #define EFI_QUESTION_ID_MAX              0xFFFF\r
 #define EFI_FREE_QUESTION_ID_BITMAP_SIZE ((EFI_QUESTION_ID_MAX + 1) / EFI_BITS_PER_UINT32)\r
 #define EFI_QUESTION_ID_INVALID          0x0\r
@@ -402,6 +419,8 @@ public:
   EFI_VFR_RETURN_CODE BufferVarStoreAltConfigAdd (IN EFI_VARSTORE_ID, IN EFI_VARSTORE_INFO &, IN CHAR8 *, IN EFI_GUID *, IN UINT8, IN EFI_IFR_TYPE_VALUE);\r
 };\r
 \r
+extern CVfrDefaultStore gCVfrDefaultStore;\r
+\r
 #define EFI_RULE_ID_START    0x01\r
 #define EFI_RULE_ID_INVALID  0x00\r
 \r