aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/simdutf/src/lsx/lsx_convert_utf32_to_utf8.cpp
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2025-07-23 22:38:10 +0600
committerGitHub <noreply@github.com>2025-07-23 22:38:10 +0600
commit101df4a876f48c2b540177441963476a4c3b90e3 (patch)
tree80a91ef39b2498023e68b49f8d9df0381bb8e719 /contrib/simdutf/src/lsx/lsx_convert_utf32_to_utf8.cpp
parent0a1b5449fc3d709a20ce0ecc552b5a5c8ff8f45e (diff)
parent0fdcfc044eeac6521a809c56120dd5f244100b3c (diff)
downloadrspamd-master.tar.gz
rspamd-master.zip
Merge pull request #5550 from moisseev/webuiHEADmaster
[WebUI] Add history load range controls
Diffstat (limited to 'contrib/simdutf/src/lsx/lsx_convert_utf32_to_utf8.cpp')
0 files changed, 0 insertions, 0 deletions
.12.1 Mirror of Apache POI: https://github.com/apache/poiwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi/hssf/record/CellRecord.java
blob: 5ae7abebeaa6f99ce6c00f40ee62cb12fc8aaebf (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/* ====================================================================
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
==================================================================== */

package org.apache.poi.hssf.record;

import org.apache.poi.util.HexDump;
import org.apache.poi.util.LittleEndianOutput;

/**
 * Base class for all cell value records (implementors of {@link CellValueRecordInterface}).
 * Subclasses are expected to manage the cell data values (of various types).
 */
public abstract class CellRecord extends StandardRecord implements CellValueRecordInterface {
    private int _rowIndex;
    private int _columnIndex;
    private int _formatIndex;

    protected CellRecord() {
        // fields uninitialised
    }

    protected CellRecord(RecordInputStream in) {
        _rowIndex = in.readUShort();
        _columnIndex = in.readUShort();
        _formatIndex = in.readUShort();
    }

    @Override
    public final void setRow(int row) {
        _rowIndex = row;
    }

    @Override
    public final void setColumn(short col) {
        _columnIndex = col;
    }

    /**
     * set the index to the ExtendedFormat
     *
     * @see org.apache.poi.hssf.record.ExtendedFormatRecord
     * @param xf index to the XF record
     */
    @Override
    public final void setXFIndex(short xf) {
        _formatIndex = xf;
    }

    @Override
    public final int getRow() {
        return _rowIndex;
    }

    @Override
    public final short getColumn() {
        return (short) _columnIndex;
    }

    /**
     * get the index to the ExtendedFormat
     *
     * @see org.apache.poi.hssf.record.ExtendedFormatRecord
     * @return index to the XF record
     */
    @Override
    public final short getXFIndex() {
        return (short) _formatIndex;
    }

    @Override
    public final String toString() {
        StringBuilder sb = new StringBuilder();
        String recordName = getRecordName();

        sb.append("[").append(recordName).append("]\n");
        sb.append("    .row    = ").append(HexDump.shortToHex(getRow())).append("\n");
        sb.append("    .col    = ").append(HexDump.shortToHex(getColumn())).append("\n");
        sb.append("    .xfindex= ").append(HexDump.shortToHex(getXFIndex())).append("\n");
        appendValueText(sb);
        sb.append("\n");
        sb.append("[/").append(recordName).append("]\n");
        return sb.toString();
    }

    /**
     * Append specific debug info (used by {@link #toString()} for the value
     * contained in this record. Trailing new-line should not be appended
     * (superclass does that).
     * 
     * @param sb the StringBuilder to write to
     */
    protected abstract void appendValueText(StringBuilder sb);

    /**
     * Gets the debug info BIFF record type name (used by {@link #toString()}.
     * 
     * @return the record type name
     */
    protected abstract String getRecordName();

    /**
     * writes out the value data for this cell record
     * 
     * @param out the output
     */
    protected abstract void serializeValue(LittleEndianOutput out);

    /**
     * @return the size (in bytes) of the value data for this cell record
     */
    protected abstract int getValueDataSize();

    @Override
    public final void serialize(LittleEndianOutput out) {
        out.writeShort(getRow());
        out.writeShort(getColumn());
        out.writeShort(getXFIndex());
        serializeValue(out);
    }

    @Override
    protected final int getDataSize() {
        return 6 + getValueDataSize();
    }

    protected final void copyBaseFields(CellRecord rec) {
        rec._rowIndex = _rowIndex;
        rec._columnIndex = _columnIndex;
        rec._formatIndex = _formatIndex;
    }
}