 }
 */
 
-extension Int32 : LogicValue {
-  
-  public func getLogicValue() -> Bool {
+extension Int32 : BooleanType {
+  
+  public var boolValue : Bool {
     return self != 0
   }
   

    }
    
    var cstr = [CChar](count: data.count + 1, repeatedValue: 0)
    cstr.withUnsafePointerToElements { dest in  // cannot just use cstr!
      data.withUnsafePointerToElements { src in
        memcpy(dest, src, UInt(data.count))
      }
    }
    cstr[data.count] = 0 // 0-terminate
    
    // var s = "" // direct return seems to crash things, not sure why
    return cstr.withUnsafePointerToElements {
      return String.fromCString($0)!
    }
  }
  
  func dataInCStringEncoding() -> [UInt8] {
    return self.withCString { (cstr: ConstUnsafePointer<CChar>) in
      let len  = strlen(cstr)
      if len < 1 {
        return [UInt8]()
      }
      var buf = [UInt8](count: Int(len), repeatedValue: 0)
      buf.withUnsafePointerToElements { dest in
        memcpy(dest, cstr, len)
      }
      return buf
    }
  }

public extension String {
  
  static func fromCString
    (cs: UnsafePointer<CChar>, length: Int!) -> String?
  {
    if length == .None { // no length given, use \0 standard variant
      return String.fromCString(cs)
    }
    
    let buflen = length + 1
    var buf    = UnsafeMutablePointer<CChar>.alloc(buflen)
    memcpy(buf, cs, UInt(length))
    buf[length] = 0 // zero terminate
    let s = String.fromCString(buf)
