Package com.sun.jna

Examples of com.sun.jna.WString


            SVNFileUtil.setReadonly(dst, false);
            SVNFileUtil.setReadonly(src, true);
        }
        synchronized (library) {
            try {
                int rc = library.MoveFileExW(new WString(src.getAbsoluteFile().getAbsolutePath()), new WString(dst.getAbsoluteFile().getAbsolutePath()), new NativeLong(3));
                return rc != 0;
            } catch (Throwable th) {
            }
        }
        return false;
View Full Code Here


      return longPathName;
    }

    if (unicodeChars) {
      try {
        WString pathname = new WString(longPathName);

        char test[] = new char[2 + pathname.length() * 2];
        int r = Kernel32.INSTANCE.GetShortPathNameW(pathname, test, test.length);
        if (r > 0) {
          logger.debug("Forcing short path name on " + pathname);
          return Native.toString(test);
        } else {
View Full Code Here

                    if (value == null)
                        return null;
                    if (value instanceof String[]) {
                        return new StringArray((String[])value, true);
                    }
                    return new WString(value.toString());
                }
                public Object fromNative(Object value, FromNativeContext context) {
                    if (value == null)
                        return null;
                    return ((Pointer)value).getString(0, true);
View Full Code Here

      pTailBuffer  = new Pointer(pMemTail);
      pTailBuffer.setInt(0, pTail.getLength());
      pTailBuffer.setPointer(Pointer.SIZE, pTail.getPointer());
    }

    WString lpwszFileName = lpszFileName != null ? new WString(lpszFileName) : null;
    boolean result = HPSocket.SDK.HP_TcpServer_SendSmallFile(socketObj, dwConnID, lpwszFileName, pHeadBuffer, pTailBuffer);
   
    if(pMemHead != 0) Native.free(pMemHead);
    if(pMemTail != 0) Native.free(pMemTail);
   
View Full Code Here

      pTailBuffer  = new Pointer(pMemTail);
      pTailBuffer.setInt(0, pTail.getLength());
      pTailBuffer.setPointer(Pointer.SIZE, pTail.getPointer());
    }

    WString lpwszFileName = lpszFileName != null ? new WString(lpszFileName) : null;
    boolean result = HPSocket.SDK.HP_TcpAgent_SendSmallFile(socketObj, dwConnID, lpwszFileName, pHeadBuffer, pTailBuffer);
   
    if(pMemHead != 0) Native.free(pMemHead);
    if(pMemTail != 0) Native.free(pMemTail);
   
View Full Code Here

      pTailBuffer  = new Pointer(pMemTail);
      pTailBuffer.setInt(0, pTail.getLength());
      pTailBuffer.setPointer(Pointer.SIZE, pTail.getPointer());
    }

    WString lpwszFileName = lpszFileName != null ? new WString(lpszFileName) : null;
    boolean result = HPSocket.SDK.HP_TcpClient_SendSmallFile(socketObj, lpwszFileName, pHeadBuffer, pTailBuffer);
   
    if(pMemHead != 0) Native.free(pMemHead);
    if(pMemTail != 0) Native.free(pMemTail);
   
View Full Code Here

  /**
  * 启动通信组件
  */
  public boolean start(String pszBindAddress, short usPort)
  {
    WString pwszBindAddress = pszBindAddress != null ? new WString(pszBindAddress) : null;
    return HPSocket.SDK.HP_Server_Start(socketObj, pwszBindAddress, usPort);
  }
View Full Code Here

  }
 
  /** 获取最近一次失败操作的错误描述 */
  public String getLastErrorDesc()
  {
    WString desc = HPSocket.SDK.HP_Server_GetLastErrorDesc(socketObj);
    return desc != null ? desc.toString() : null;
  }
View Full Code Here

public abstract class HPSocketObj extends HPSocketObjBase
{
  /** 获取错误描述文本 */
  public static String getSocketErrorDesc(int code)
  {
    WString desc = HPSocket.SDK.HP_GetSocketErrorDesc(code);
    return desc != null ? desc.toString() : null;
  }
View Full Code Here

  /**
  * 启动通信组件
  */
  public boolean start(String pszRemoteAddress, short usPort, boolean bAsyncConnect)
  {
    WString pwszRemoteAddress = pszRemoteAddress != null ? new WString(pszRemoteAddress) : null;
    return HPSocket.SDK.HP_Client_Start(socketObj, pwszRemoteAddress, usPort, bAsyncConnect);
  }
View Full Code Here

TOP

Related Classes of com.sun.jna.WString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.