IPXV_Inst::FormatFileSize Method

From PDF XChange PDF SDK
Jump to: navigation, search
m (Automatic page editing by robot)
m (Automatic page editing by robot)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
__NOTOC__
 
[[Category:Editor]]
 
[[Category:Editor]]
 
{{#customTitle:IPXV_Inst::FormatFileSize Method}}
 
{{#customTitle:IPXV_Inst::FormatFileSize Method}}
 +
{{#parentPage:PXV:IPXV_Inst#Methods|FormatFileSize|method}}
 +
{{ToReview}}
  
The method of interface of PDF-XChange Editor SDK.
+
Converts the specified file size in bytes to display string. For example:
 +
 
 +
::<tt>349 to "0.34 KB (349 bytes)"</tt>
 +
::<tt>8791 to "8.58 KB (8,791 bytes)"</tt>
 +
::<tt>4022817 to "3.84 MB (4,022,817 bytes)"</tt>
 +
 
 +
The method uses the current UI-localization.
  
 
== Syntax ==
 
== Syntax ==
<pre class="brush:cpp;gutter:false">HRESULT FormatFileSize([in] ULONGLONG nSize, [in, defaultvalue(0)] VARIANT_BOOL bShort, [out, retval] BSTR* ppRes);</pre>
+
<pre class="brush:cpp;gutter:false">HRESULT FormatFileSize([in]                   ULONGLONG     nSize,
 +
                      [in, defaultvalue(0)] VARIANT_BOOL bShort,
 +
                      [out, retval]         BSTR*         sRes);</pre>
  
 
== Parameters ==
 
== Parameters ==
;''nSize''
+
;nSize
:[in]  Value of ULONGLONG.
+
:[in]  Number of bytes.
;''bShort''
+
;bShort
:[in, defaultvalue(0)]  Value of VARIANT_BOOL.
+
:[in, defaultvalue(0)]  Specifies the option to make short display-string. For example with <tt>true</tt> value you will get <tt>"0.34 KB"</tt> instead of <tt>"0.34 KB (349 bytes)"</tt>.
;''ppRes''
+
;sRes
:[out, retval]  Pointer to BSTR.
+
:[out, retval]  Returns string as result of converting.
  
 
== Return Value ==
 
== Return Value ==
Line 19: Line 30:
  
 
== See Also ==
 
== See Also ==
See also [[PXV:IPXV_Inst|IPXV_Inst]].
+
[[PXV:IPXV_Inst|IPXV_Inst]]

Latest revision as of 03:56, 15 June 2015


Converts the specified file size in bytes to display string. For example:

349 to "0.34 KB (349 bytes)"
8791 to "8.58 KB (8,791 bytes)"
4022817 to "3.84 MB (4,022,817 bytes)"

The method uses the current UI-localization.

Syntax

HRESULT FormatFileSize([in]                   ULONGLONG     nSize,
                       [in, defaultvalue(0)]  VARIANT_BOOL  bShort,
                       [out, retval]          BSTR*         sRes);

Parameters

nSize
[in] Number of bytes.
bShort
[in, defaultvalue(0)] Specifies the option to make short display-string. For example with true value you will get "0.34 KB" instead of "0.34 KB (349 bytes)".
sRes
[out, retval] Returns string as result of converting.

Return Value

Returns S_OK if operation was successful or error code in other cases.

See Also

IPXV_Inst