Check-in [a2e7a01986]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add write to byte array version of the database.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:a2e7a01986199a018b81bc13c4bad394cd2426df
User & Date: stephanie.gawroriski 2019-07-13 14:44:50
Context
2019-07-13
15:47
Set attributes in the ROM database; Write of name and attributes. check-in: f1cdff6ee7 user: stephanie.gawroriski tags: trunk
14:44
Add write to byte array version of the database. check-in: a2e7a01986 user: stephanie.gawroriski tags: trunk
14:41
Write part of the database fields. check-in: 49d76c6c68 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to bldt/libs/builder-support/cc/squirreljme/builder/support/dist/PalmOSDist.java.

104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
				// Make sure all fragments are the same size
				if (ent.size() < ROM_FRAGMENT_SIZE)
					ent.write(0);
			}
		}
		
		// Write the output
		db.write(__out);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/07/13
	 */
	@Override







|







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
				// Make sure all fragments are the same size
				if (ent.size() < ROM_FRAGMENT_SIZE)
					ent.write(0);
			}
		}
		
		// Write the output
		db.writeTo(__out);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/07/13
	 */
	@Override

Changes to bldt/libs/palmos-utils/dev/shadowtail/palmos/PalmDatabaseBuilder.java.

5
6
7
8
9
10
11

12
13
14
15
16
17
18
...
124
125
126
127
128
129
130

























131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package dev.shadowtail.palmos;


import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;

/**
 * This class is used to build PalmOS databases and resource databases.
................................................................................
	{
		if (__type == null)
			throw new NullPointerException("NARG");
		
		this._type = __type;
		return this;
	}

























	
	/**
	 * Writes the database to the output.
	 *
	 * @param __out The output stream.
	 * @throws IOException On write errors.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/07/13
	 */
	public final void write(OutputStream __out)
		throws IOException, NullPointerException
	{
		if (__out == null)
			throw new NullPointerException("NARG");
		
		throw new todo.TODO();
	}
}








>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>









|









5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
...
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package dev.shadowtail.palmos;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;

/**
 * This class is used to build PalmOS databases and resource databases.
................................................................................
	{
		if (__type == null)
			throw new NullPointerException("NARG");
		
		this._type = __type;
		return this;
	}
	
	/**
	 * Returns the byte array representing the database.
	 *
	 * @return The byte array of the database.
	 * @since 2019/07/13
	 */
	public final byte[] toByteArray()
	{
		// Just write to a stream
		try (ByteArrayOutputStream baos = new ByteArrayOutputStream())
		{
			// Write the database info
			this.writeTo(baos);
			
			// Return the resulting array
			return baos.toByteArray();
		}
		
		// {@squirreljme.error BP01 Could not write the database.}
		catch (IOException e)
		{
			throw new RuntimeException("BP01", e);
		}
	}
	
	/**
	 * Writes the database to the output.
	 *
	 * @param __out The output stream.
	 * @throws IOException On write errors.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/07/13
	 */
	public final void writeTo(OutputStream __out)
		throws IOException, NullPointerException
	{
		if (__out == null)
			throw new NullPointerException("NARG");
		
		throw new todo.TODO();
	}
}