Skip to content

Commit

Permalink
abstract string enum for Cpu.ProcessorInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
tong committed Jun 7, 2016
1 parent a4a2f0a commit c815962
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/chrome/system/Cpu.hx
@@ -1,6 +1,6 @@
package chrome.system;

private typedef Processor = {
typedef Processor = {
var usage : {
user : Float,
kernel : Float,
Expand All @@ -9,9 +9,19 @@ private typedef Processor = {
};
}

@:enum abstract ProcessorFeature(String) from String to String {
var mmx = "mmx";
var sse = "sse";
var sse2 = "sse2";
var sse3 = "sse3";
var sse4_1 = "sse4_1";
var sse4_2 = "sse4_2";
var avx = "avx";
}

@:require(chrome)
@:native("chrome.system.cpu")
extern class Cpu {
static function getInfo( callback : {numOfProcessors:Int,archName:String,modelName:String,features:Array<String>,processors:Array<Processor>}->Void ) : Void;
static function getInfo( callback : {numOfProcessors:Int,archName:String,modelName:String,features:Array<ProcessorFeature>,processors:Array<Processor>}->Void ) : Void;

}

0 comments on commit c815962

Please sign in to comment.