Package quicktime.util

Source Code of quicktime.util.StringHandle

/*     */ package quicktime.util;
/*     */
/*     */ import quicktime.QTException;
/*     */ import quicktime.QTObject;
/*     */ import quicktime.std.image.CodecName;
/*     */
/*     */ public class StringHandle extends QTHandleRef
/*     */ {
/*     */   public static final int kCStringFormat = 1;
/*     */   public static final int kPStringFormat = 2;
/*     */   private int strFormat;
/*     */
/*     */   public static StringHandle fromCodecName(CodecName paramCodecName)
/*     */   {
/*  35 */     int i = getIntFromPointer(QTObject.ID(paramCodecName), 40);
/*  36 */     return new StringHandle(i, paramCodecName, 2);
/*     */   }
/*     */
/*     */   public StringHandle(String paramString, int paramInt)
/*     */     throws QTException
/*     */   {
/*  48 */     super(paramString.length() + 1, false);
/*  49 */     this.strFormat = paramInt;
/*  50 */     if (this.strFormat == 1) {
/*  51 */       setCStringAt(0, paramString.length(), paramString);
/*  52 */     } else if (this.strFormat == 2) {
/*  53 */       if (paramString.length() > 255) throw new QTException(-50);
/*  54 */       setPStringAt(0, paramString.length(), paramString);
/*     */     }
/*     */     else {
/*  57 */       throw new QTException(-50);
/*     */     }
/*     */   }
/*     */
/*  61 */   protected StringHandle(int paramInt1, Object paramObject, int paramInt2) { super(paramInt1, paramObject, false);
/*  62 */     this.strFormat = paramInt2;
/*     */   }
/*     */
/*     */   public int getStringLength()
/*     */   {
/*  74 */     return getSize() - 1;
/*     */   }
/*     */
/*     */   public int getFormat()
/*     */   {
/*  81 */     return this.strFormat;
/*     */   }
/*     */
/*     */   public String toJavaString()
/*     */     throws UtilException
/*     */   {
/*  88 */     return this.strFormat == 1 ? getCStringAt(0) : getPStringAt(0);
/*     */   }
/*     */
/*     */   public void fromJavaString(String paramString)
/*     */     throws UtilException
/*     */   {
/*  97 */     if (this.strFormat == 1)
/*  98 */       setCStringAt(0, getSize(), paramString);
/*     */     else
/* 100 */       setPStringAt(0, 255 > getSize() ? getSize() : 255, paramString);
/*     */   }
/*     */
/*     */   public String toString()
/*     */   {
/*     */     try
/*     */     {
/* 109 */       return getClass().getName() + "[" + toJavaString() + "]"; } catch (UtilException localUtilException) {
/*     */     }
/* 111 */     return getClass().getName() + "[]";
/*     */   }
/*     */
/*     */   private static native int getIntFromPointer(int paramInt1, int paramInt2);
/*     */ }

/* Location:           Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name:     quicktime.util.StringHandle
* JD-Core Version:    0.6.2
*/
TOP

Related Classes of quicktime.util.StringHandle

TOP
Copyright © 2018 www.massapi.com. 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.