Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/haxe/src/org/apache/thrift/AbstractMethodError.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.thrift;

#if flash
Expand All @@ -25,16 +25,16 @@ import flash.errors.IllegalOperationError;
import org.apache.thrift.TException;
#end

class AbstractMethodError
class AbstractMethodError
#if flash
extends IllegalOperationError
extends IllegalOperationError
#else
extends TException
#end
{

public function new(message : String="") {
super("Attempt to call an abstract method");
}
public function new(message : String="") {
super("Attempt to call an abstract method");
}

}
8 changes: 4 additions & 4 deletions lib/haxe/src/org/apache/thrift/ArgumentError.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.thrift;

#if ! flash
// predefined for flash only
class ArgumentError extends TException {
public function new(msg : String = "") {
super(msg);
}
public function new(msg : String = "") {
super(msg);
}
}
#end
42 changes: 21 additions & 21 deletions lib/haxe/src/org/apache/thrift/Limits.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.thrift;

class Limits {

// Haxe limits are not fixed values, they depend on the target platform
// For example, neko limits an int to 31 bits instead of 32. So we detect
// the values once during intialisation in order to
// (a) get the right values for the current platform, and
// (b) prevent us from dependecies to a bunch of defines

public static var I32_MAX = {
var last : Int = 0;
var next : Int = 0;
for(bit in 0 ... 32) {
last = next;
next = last | (1 << bit);
if(next < 0) {
break;
}
}
last; // final value
}

// add whatever you need
// Haxe limits are not fixed values, they depend on the target platform
// For example, neko limits an int to 31 bits instead of 32. So we detect
// the values once during intialisation in order to
// (a) get the right values for the current platform, and
// (b) prevent us from dependecies to a bunch of defines

public static var I32_MAX = {
var last : Int = 0;
var next : Int = 0;
for(bit in 0 ... 32) {
last = next;
next = last | (1 << bit);
if(next < 0) {
break;
}
}
last; // final value
}

// add whatever you need
}
6 changes: 3 additions & 3 deletions lib/haxe/src/org/apache/thrift/TApplicationException.hx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import org.apache.thrift.protocol.TType;
*/
class TApplicationException extends TException {

private static var TAPPLICATION_EXCEPTION_STRUCT = { new TStruct("TApplicationException"); };
private static var MESSAGE_FIELD = { new TField("message", TType.STRING, 1); };
private static var TYPE_FIELD = { new TField("type", TType.I32, 2); };
private static var TAPPLICATION_EXCEPTION_STRUCT = { new TStruct("TApplicationException"); };
private static var MESSAGE_FIELD = { new TField("message", TType.STRING, 1); };
private static var TYPE_FIELD = { new TField("type", TType.I32, 2); };

public static inline var UNKNOWN : Int = 0;
public static inline var UNKNOWN_METHOD : Int = 1;
Expand Down
14 changes: 7 additions & 7 deletions lib/haxe/src/org/apache/thrift/TBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,38 @@ import org.apache.thrift.protocol.TProtocol;
*
*/
interface TBase {

/**
* Reads the TObject from the given input protocol.
*
* @param iprot Input protocol
*/
function read(iprot:TProtocol) : Void;

/**
* Writes the objects out to the protocol
*
* @param oprot Output protocol
*/
function write(oprot:TProtocol) : Void;

/**
* Check if a field is currently set or unset.
*
* @param fieldId The field's id tag as found in the IDL.
*/
function isSet(fieldId : Int) : Bool;

/**
* Get a field's value by id. Primitive types will be wrapped in the
* Get a field's value by id. Primitive types will be wrapped in the
* appropriate "boxed" types.
*
* @param fieldId The field's id tag as found in the IDL.
*/
function getFieldValue(fieldId : Int) : Dynamic;

/**
* Set a field's value by id. Primitive types must be "boxed" in the
* Set a field's value by id. Primitive types must be "boxed" in the
* appropriate object wrapper type.
*
* @param fieldId The field's id tag as found in the IDL.
Expand Down
25 changes: 13 additions & 12 deletions lib/haxe/src/org/apache/thrift/TException.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.thrift;

class TException {

@:isVar
public var errorID(default,null) : Int;
@:isVar
public var errorMsg(default,null) : String;


public function new(msg : String = "", id : Int = 0) {
errorID = id;
errorMsg = msg;
}

@:isVar
public var errorID(default,null) : Int;
@:isVar
public var errorMsg(default,null) : String;


public function new(msg : String = "", id : Int = 0) {
errorID = id;
errorMsg = msg;
}

}

2 changes: 1 addition & 1 deletion lib/haxe/src/org/apache/thrift/TFieldRequirementType.hx
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ class TFieldRequirementType {
public static inline var REQUIRED : Int = 1;
public static inline var OPTIONAL : Int = 2;
public static inline var DEFAULT : Int = 3;

}
2 changes: 1 addition & 1 deletion lib/haxe/src/org/apache/thrift/TProcessor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ import org.apache.thrift.protocol.TProtocol;
* writes to some output stream.
*/
interface TProcessor {
function process(input:TProtocol, output:TProtocol) : Bool;
function process(input:TProtocol, output:TProtocol) : Bool;
}
Loading