forked from iryndin/jdbf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request iryndin#2 from bugy/master
Minor improvements
- Loading branch information
Showing
5 changed files
with
544 additions
and
473 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,42 @@ | ||
<project name="jdbf" default="jar" basedir="."> | ||
|
||
<description>jdbf - Java library to write/read DBF files</description> | ||
|
||
<property name="src.dir" location="${basedir}/src" /> | ||
<property name="build.dir" location="${basedir}/build" /> | ||
<property name="src.generated.dir" location="${build.dir}/java_generated_${version.tag}" /> | ||
<property name="classes.dir" location="${build.dir}/classes"/> | ||
<property name="dist.dir" location="${build.dir}/dist"/> | ||
<property name="jar.filename" location="${dist.dir}/jdbf.jar"/> | ||
|
||
<path id="main.classpath"> | ||
<pathelement path="${classes.dir}" /> | ||
</path> | ||
|
||
<target name="mkdirs"> | ||
<mkdir dir="${build.dir}" /> | ||
<mkdir dir="${classes.dir}" /> | ||
<mkdir dir="${dist.dir}" /> | ||
</target> | ||
|
||
<target name="clean"> | ||
<delete dir="${build.dir}" /> | ||
</target> | ||
|
||
<target name="compile" description="compile the source" depends="clean,mkdirs"> | ||
<javac destdir="${classes.dir}" debug="true"> | ||
<src path="${src.dir}"/> | ||
<classpath refid="main.classpath" /> | ||
</javac> | ||
</target> | ||
|
||
<target name="jar" description="Create JAR file" depends="compile"> | ||
<jar destfile="${jar.filename}" basedir="${classes.dir}"/> | ||
</target> | ||
|
||
|
||
<description>jdbf - Java library to write/read DBF files</description> | ||
|
||
<property name="src.dir" location="${basedir}/src"/> | ||
<property name="build.dir" location="${basedir}/build"/> | ||
<property name="src.generated.dir" location="${build.dir}/java_generated_${version.tag}"/> | ||
<property name="classes.dir" location="${build.dir}/classes"/> | ||
<property name="dist.dir" location="${build.dir}/dist"/> | ||
<property name="jar-name" value="jdbf"/> | ||
<property name="jar.filename" value="${jar-name}.jar"/> | ||
<property name="src-zip.filename" value="${jar-name}-src.zip"/> | ||
|
||
<path id="main.classpath"> | ||
<pathelement path="${classes.dir}"/> | ||
</path> | ||
|
||
<target name="mkdirs"> | ||
<mkdir dir="${build.dir}"/> | ||
<mkdir dir="${classes.dir}"/> | ||
<mkdir dir="${dist.dir}"/> | ||
</target> | ||
|
||
<target name="clean"> | ||
<delete dir="${build.dir}"/> | ||
</target> | ||
|
||
<target name="compile" description="compile the source" depends="clean,mkdirs"> | ||
<javac destdir="${classes.dir}" debug="true"> | ||
<src path="${src.dir}"/> | ||
<classpath refid="main.classpath"/> | ||
</javac> | ||
</target> | ||
|
||
<target name="jar" description="Create JAR file" depends="compile"> | ||
<jar destfile="${dist.dir}/${jar.filename}" basedir="${classes.dir}"/> | ||
|
||
<zip zipfile="${dist.dir}/${src-zip.filename}" basedir="${basedir}/src" | ||
compress="true"/> | ||
</target> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,40 @@ | ||
package net.iryndin.jdbf.core; | ||
|
||
public enum DbfFieldTypeEnum { | ||
Character('C'), | ||
Currency('Y'), | ||
Numeric('N'), | ||
Float('F'), | ||
Date('D'), | ||
DateTime('T'), | ||
Double('B'), | ||
Integer('I'), | ||
Logical('L'), | ||
Memo('M'), | ||
General('G'), | ||
Picture('P'); | ||
|
||
final char type; | ||
|
||
DbfFieldTypeEnum(char type) { | ||
this.type= type; | ||
} | ||
|
||
public static DbfFieldTypeEnum fromChar(char type) { | ||
for (DbfFieldTypeEnum e : DbfFieldTypeEnum.values()) { | ||
if (e.type == type) { | ||
return e; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
public byte toByte() { | ||
return (byte)type; | ||
} | ||
|
||
public char getType() { | ||
return type; | ||
} | ||
Character('C'), | ||
Currency('Y'), | ||
Numeric('N'), | ||
Float('F'), | ||
Date('D'), | ||
DateTime('T'), | ||
Double('B'), | ||
Integer('I'), | ||
Logical('L'), | ||
Memo('M'), | ||
General('G'), | ||
Picture('P'), | ||
NullFlags('0'); | ||
|
||
final char type; | ||
|
||
DbfFieldTypeEnum(char type) { | ||
this.type = type; | ||
} | ||
|
||
public static DbfFieldTypeEnum fromChar(char type) { | ||
for (DbfFieldTypeEnum e : DbfFieldTypeEnum.values()) { | ||
if (e.type == type) { | ||
return e; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
public byte toByte() { | ||
return (byte) type; | ||
} | ||
|
||
public char getType() { | ||
return type; | ||
} | ||
} |
Oops, something went wrong.