BLOB PROPERTIES
BLOB PROPERTIES* ( BLOB ; compressed {; expandedSize {; currentSize}} )
| 引数 | 型 | 説明 | |
|---|---|---|---|
| Blob | Blob | → | 情報を取得するBLOB | 
| compressed | Integer | ← | 0 = BLOBは圧縮されていない 1 = BLOBは圧縮率優先で圧縮されている 2 = BLOBは速度優先で圧縮されている | 
| expandedSize | Integer | ← | 非圧縮時のBLOBのサイズ (バイト単位) | 
| currentSize | Integer | ← | BLOBの現在のサイズ (バイト単位) | 
説明
*BLOB PROPERTIES**コマンドは、BLOB blobに関する情報を返します。
compressed引数はBLOBが圧縮されたかどうかを示す値を返します。この値をBLOBテーマの以下の定義済定数と比較できます。
| 定数 | 型 | 値 | コメント | 
|---|---|---|---|
| Compact compression mode | 倍長整数 | 1 | 圧縮解凍の処理速度と引き換えに、BLOBをできるだけ小さく圧縮します。デフォルトモード。 | 
| Fast compression mode | 倍長整数 | 2 | 圧縮率と引き換えにBLOBをできるだけ速く圧縮・解凍します (圧縮されたBLOBのサイズは大きくなります)。 | 
| GZIP best compression mode | 倍長整数 | -1 | GZIP圧縮で圧縮率を優先します。 | 
| GZIP fast compression mode | 倍長整数 | -2 | GZIP圧縮で速度を優先します。 | 
| Is not compressed | 倍長整数 | 0 | 
BLOBの圧縮ステータスにかかわらず、expandedSize引数は、圧縮されていない時のBLOBのサイズを戻します。
currentSize引数は、BLOBの現在のサイズを戻します。BLOBが圧縮されている場合には、通常、expandedSizeより小さいcurrentSizeを取得します。BLOBが圧縮されていない場合には、常に、expandedSizeに等しいcurrentSizeを取得します。
例題 1
COMPRESS BLOBおよびEXPAND BLOBの例を参照。
例題 2
BLOBが圧縮された後、以下のプロジェクトメソッドは圧縮できたメモリ空間の割合を返します:
  // Space saved by compression プロジェクトメソッド
  // Space saved by compression (Pointer {; Pointer } ) -> Long
  // Space saved by compression ( -> BLOB {; -> savedBytes } ) -> Percentage
 
#DECLARE ($blob : Pointer ; $saved : Pointer ) -> $percent : Integer
 var $vlCompressed;$vlExpandedSize;$vlCurrentSize : Integer
 
 BLOB PROPERTIES($blob->;$vlCompressed;$vlExpandedSize;$vlCurrentSize)
 If($vlExpandedSize=0)
    $percent:=0
    If(Count parameters>=2)
       $saved->:=0
    End if
 Else
    $percent:=100-(($vlCurrentSize/$vlExpandedSize)*100)
    If(Count parameters>=2)
       $saved->:=$vlExpandedSize-$vlCurrentSize
    End if
 End if
このメソッドがアプリケーションに追加された後は、これを以下のように使用できます:
  // ...
 COMPRESS BLOB(vxBlob)
 $vlPercent:=Space saved by compression(->vxBlob;->vlBlobSize)
 ALERT("The compression saved "+String(vlBlobSize)+" bytes, so "+String($vlPercent;"#0%")+
 " of space.")
参照
プロパティ
| コマンド番号 | 536 | 
| スレッドセーフである | ✓ |