컬럼에 번호 달기
이름 뒤에 @N 을 달면 바이너리 파일이 컬럼을 위치가 아니라 번호로
가리킵니다. 이미 배포된 클라이언트가 컬럼 순서 변경을 견디게 하는 장치입니다.
한 테이블 안에서 전부 달거나 전부 안 답니다. 지운 컬럼은
#이름@N 으로 남겨 그 번호를 예약합니다.
- C#
- TypeScript
- C++
- Python
- C
- Dart
- Go
- Java
- Kotlin
- Lua
- PHP
- Ruby
- Rust
- Swift
- Unreal
[System.Serializable]
public partial class WireRecord
{
#region Values
/// <summary>
/// primary index
/// </summary>
public int Index => _index;
/// <summary>
/// display name
/// </summary>
public string Name => _name;
/// <summary>
/// added after the drop
/// </summary>
public int Price => _price;
#endregion
#region Storage
internal int _index;
internal string _name = "";
internal int _price;
#endregion
#region ToString
public override string ToString()
{
var sb = new StringBuilder("{");
sb.Append("\"Index\":"); ToStringHelper.ToString(Index, sb);
sb.Append(",\"Name\":"); ToStringHelper.ToString(Name, sb);
sb.Append(",\"Price\":"); ToStringHelper.ToString(Price, sb);
sb.Append("}");
return sb.ToString();
}
#endregion
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : G2
/** Columns numbered so the file names them rather than counts them. */
export class WireRecord {
/** Default constructor */
constructor() {
}
/** primary index */
public get index(): number { return this._index }
/** display name */
public get name(): string { return this._name }
/** added after the drop */
public get price(): number { return this._price }
public _index: number = 0
public _name: string = ''
public _price: number = 0
/** Populate field values. */
public populateFieldValues(dataRow: IDataRow): void {
this._index = dataRow.index
this._name = dataRow.name
this._price = dataRow.price
}
/** Populate field values. */
public populateFieldValuesCompact(dataRow: any[]): void {
let offset = 0
this._index = dataRow[offset++]
this._name = dataRow[offset++]
this._price = dataRow[offset++]
}
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : G2
/// Columns numbered so the file names them rather than counts them.
struct WireRecord {
/// primary index
std::int32_t index = 0;
/// display name
std::string name;
/// added after the drop
std::int32_t price = 0;
};
class WireRecord:
"""Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : G2.
Columns numbered so the file names them rather than counts them.
"""
__slots__ = ("index", "name", "price")
def __init__(self):
self.index = 0
self.name = ""
self.price = 0
def __repr__(self):
return "WireRecord(index=%r, name=%r, price=%r)" % (self.index, self.name, self.price)
/* Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : G2
*
* Columns numbered so the file names them rather than counts them.
*/
struct DocShowcase_WireRecord_t {
/* primary index */
int32_t index;
/* display name */
const char* name;
/* added after the drop */
int32_t price;
};
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : G2
/// Columns numbered so the file names them rather than counts them.
class WireRecord {
/// primary index
int index = 0;
/// display name
String name = '';
/// added after the drop
int price = 0;
}
// WireRecord was generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : G2.
// Columns numbered so the file names them rather than counts them.
type WireRecord struct {
// primary index
Index int32
// display name
Name string
// added after the drop
Price int32
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : G2
/** Columns numbered so the file names them rather than counts them. */
public final class WireRecord {
/** primary index */
public int index;
/** display name */
public String name = "";
/** added after the drop */
public int price;
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : G2
/** Columns numbered so the file names them rather than counts them. */
class WireRecord {
/** primary index */
var index: Int = 0
/** display name */
var name: String = ""
/** added after the drop */
var price: Int = 0
}
-- Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : G2.
-- Columns numbered so the file names them rather than counts them.
---@class WireRecord
---@field index integer
---@field name string
---@field price integer
local WireRecordMeta = tcb.strictType("a `Wire` row", { "index", "name", "price" })
/**
* Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : G2
*
* Columns numbered so the file names them rather than counts them.
*/
final class WireRecord
{
/** primary index */
public int $index = 0;
/** display name */
public string $name = '';
/** added after the drop */
public int $price = 0;
}
# Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : G2
# Columns numbered so the file names them rather than counts them.
class WireRecord
attr_accessor :index, :name, :price
def initialize
@index = 0
@name = ''
@price = 0
end
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : G2
/// Columns numbered so the file names them rather than counts them.
#[derive(Clone, Debug, Default)]
pub struct WireRecord {
/// primary index
pub index: i32,
/// display name
pub name: String,
/// added after the drop
pub price: i32,
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : G2
/// Columns numbered so the file names them rather than counts them.
public final class WireRecord {
public init() {}
/// primary index
public var index: Int32 = 0
/// display name
public var name: String = ""
/// added after the drop
public var price: Int32 = 0
}
// Generated from test/fixtures/xlsx/doc-showcase/doc-showcase.xlsx : Index : G2
/** Columns numbered so the file names them rather than counts them. */
USTRUCT(BlueprintType)
struct DOCSHOWCASE_API FWireRow
{
GENERATED_BODY()
/** primary index */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Wire")
int32 Index = 0;
/** display name */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Wire")
FString Name;
/** added after the drop */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Wire")
int32 Price = 0;
};
생성된 코드에 번호는 없습니다. @N 은 파일이 컬럼을 가리키는
방법이고, 코드가 보는 것은 멤버 이름뿐입니다 — OldColour 는 아예 없습니다.
한 번 데이터를 실은 번호는 다시 쓸 수 없습니다. 그래서 지울 때 #이름@N 을 남깁니다 —
자세한 것은 바이너리 형식에 있습니다.