summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibSQL/Row.cpp
blob: ec92df2d9570a5176baaab016b24acf1b9a38e5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * Copyright (c) 2021, Jan de Visser <jan@de-visser.net>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <LibSQL/Meta.h>
#include <LibSQL/Row.h>

namespace SQL {

Row::Row(NonnullRefPtr<TableDef> table, u32 pointer)
    : Tuple(table->to_tuple_descriptor())
    , m_table(move(table))
{
    set_pointer(pointer);
}

void Row::deserialize(Serializer& serializer)
{
    Tuple::deserialize(serializer);
    m_next_pointer = serializer.deserialize<u32>();
}

void Row::serialize(Serializer& serializer) const
{
    Tuple::serialize(serializer);
    serializer.serialize<u32>(next_pointer());
}

}