GW2RegisterOutFile
Ang function na GW2RegisterOutFile ay nagrerehistro ng destinasyon para sa managed file na ginawa ng Glasswall. Ang paggamit ng function na ito ay nag-a-activate sa Manage & Protect Process Mode para sa session.
- C++
- C#
- Java
- Python
- JavaScript
Buod
Para sa session na session, ang function na GW2RegisterOutFile ay nagrerehistro ng file na ang pangalan ay ang string na tinutukoy ng outputFileBuffer bilang destination file para sa managed file na ginawa ng Glasswall. Ang base name ng path ay dapat naiiba sa base name na nairehistro gamit ang function na GW2RegisterInputFile. Ang paggamit ng function na ito ay nag-a-activate sa Manage & Protect Process Mode para sa session.
#include "glasswall.core2.api.h"
int GW2RegisterOutFile(Session session, const char *outputFilePath);
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.
Halimbawa
#include "glasswall.core2.api.h"
HANDLE session = GW2OpenSession();
if (!session)
/* deal with error */
else
{
if (GW2RegisterOutFile(session, "managed_file.docx") < 0)
/* deal with error */
else
/* continue processing */
...
}
/* later */
if (GW2CloseSession(session) < 0)
/* error closing session */
Buod
public int RegisterOutFile(
int session,
string outputFilePath)
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.
Buod
import com.glasswall.core2javabridge.*;
public int GW2RegisterOutFile(int session, String outputFilePath) throws GlasswallException, NullPointerException
(Deprecated)
public int GW2RegisterOutFile(int session, byte[] outputFilePath) throws GlasswallException, NullPointerException
Tandaan
Ang mga parameter ng function na GW2RegisterOutFile ay na-update upang gumamit ng String kapalit ng byte[]. Ang orihinal na function ay deprecated na.
Ibinabalik
Ang function na GW2RegisterOutFile ay nagbabalik ng GW2_RetStatus enumeration na kino-convert sa int. Magiging negatibo ang value kung may naganap na error. Ang 0 ay nagpapahiwatig ng tagumpay. Sumangguni sa API Overview/Return types para sa mga detalye.
Isang NullPointerException exception ang ita-throw kung ang outputFilePath ay null o walang laman.
Isang GlasswallException exception ang ita-throw kung hindi wasto ang session, kung hindi makuha ang outputFilePath, o kung hindi ma-convert sa UTF-8 ang outputFilePath.
Buod
Magrehistro ng output file para sa ibinigay na session. Kung ang output_file ay None, ibabalik ang file bilang mga attribute na 'buffer' at 'buffer_length'.
def register_output(self, session, output_file: Optional[str] = None):
""" Register an output file for the given session. If output_file is None the file will be returned as 'buffer' and 'buffer_length' attributes.
Args:
session (int): The session integer.
output_file (Optional[str]): If specified, during run session the file will be written to output_file, otherwise the file will be written to the glasswall.GwReturnObj 'buffer' and 'buffer_length' attributes.
Returns:
gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attribute 'status' indicating the result of the function call. If output_file is None (memory mode), 'buffer', and 'buffer_length' are included containing the file content and file size.
"""
Ibinabalik
gw_return_object (glasswall.GwReturnObj): Isang instance ng GwReturnObj na may attribute na 'status' na nagsasaad ng resulta ng function call. Kung ang output_file ay None (memory mode), kasama ang 'buffer' at 'buffer_length' na naglalaman ng nilalaman ng file at laki ng file.
Ang status attribute ay isang integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng failure.
Buod
Nirerehistro ng function na ito ang destination file para sa managed file na ginawa ng Glasswall.
/**
* @param {number} session The ID of the session.
* @param {string} outputFilePath The specified output path. Must be different to the specified input file path.
*/
GW2RegisterOutFile(
session,
outputFilePath)
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.