deserializeProtoBuf

説明

Protobuf 文字列データ表現を、CFML 構造体や CFML 配列などの CFML データに変換します。

戻り値

ColdFusion 形式のデータ値:構造体、配列、クエリ、単純値

シンタックス

deserializeProtoBuf(data, schema, messageType, queryFormat, useCustomSerialization, protoPath)
deserializeProtoBuf(data, schema, messageType, queryFormat, useCustomSerialization, protoPath)
deserializeProtoBuf(data, schema, messageType, queryFormat, useCustomSerialization, protoPath)

パラメーター

パラメーター 必須 説明
data はい ColdFusion データ値、または ColdFusion データ値を表す変数です。
schema はい protobuf スキーマ。プレーン文字列として指定することも、ファイルパスとして直接指定することもできます。
messageType はい 指定されたスキーマに定義されているメッセージタイプを表す文字列。スキーマに含まれているメッセージタイプが 1 つだけの場合、これはオプションです。
strictMapping いいえ これは文字列タイプのパラメーターで、「row」、「column」、「struct」のいずれかの値を指定できます。デフォルト値は「struct」です。
useCustomSerialization いいえ true または false です。customSerializer を使用するかどうかを指定します。デフォルト値は true です。シリアル化には必ず、カスタムシリアライザーが使用されます。false の場合、シリアル化は ColdFusion のデフォルト動作を使用して実行されます。
protoPath いいえ スキーマで定義されている読み込み済みファイルをコンパイラーが探すディレクトリを指定します。デフォルトでは、現在のスキーマの親パスになります。

<cfscript>
// データを定義
data = {
“order_id”: 32,
“order_date”: “09-09-2022”,
“order_amount”: 345,
“customer”:{
“customer_id”:344,
“customer_name”:“Jack”
}
}
protoSerRes = serializeProtoBuf(data,'Order.proto','Order','struct',false);
writedump(protoSerRes)
protoDeSerRes=deserializeProtoBuf(protoSerRes,'/protofiles/Orderr.proto','Order',false,false);
writeDump(protoDeSerRes)
</cfscript>
<cfscript> // データを定義 data = { “order_id”: 32, “order_date”: “09-09-2022”, “order_amount”: 345, “customer”:{ “customer_id”:344, “customer_name”:“Jack” } } protoSerRes = serializeProtoBuf(data,'Order.proto','Order','struct',false); writedump(protoSerRes) protoDeSerRes=deserializeProtoBuf(protoSerRes,'/protofiles/Orderr.proto','Order',false,false); writeDump(protoDeSerRes) </cfscript>
<cfscript>
    // データを定義
    data = {
        “order_id”: 32,
        “order_date”: “09-09-2022”,
        “order_amount”: 345,
        “customer”:{
            “customer_id”:344,
            “customer_name”:“Jack”
        }
    }
    protoSerRes = serializeProtoBuf(data,'Order.proto','Order','struct',false); 
    writedump(protoSerRes) 
    protoDeSerRes=deserializeProtoBuf(protoSerRes,'/protofiles/Orderr.proto','Order',false,false); 
    writeDump(protoDeSerRes) 
</cfscript>

ヘルプをすばやく簡単に入手

新規ユーザーの場合