Package quicktime.std.qtcomponents

Source Code of quicktime.std.qtcomponents.XMLContent

/*     */ package quicktime.std.qtcomponents;
/*     */
/*     */ import quicktime.QTException;
/*     */ import quicktime.QTObject;
/*     */ import quicktime.QTSession;
/*     */ import quicktime.std.StdQTException;
/*     */ import quicktime.util.QTUtils;
/*     */ import quicktime.util.UtilException;
/*     */
/*     */ public final class XMLContent extends QTObject
/*     */ {
/*  40 */   private static boolean apriori = QTSession.apriori();
/*     */
/*  44 */   private static Object owner = new Object();
/*     */   private static final int kXMLElementContentDataSize = 20;
/*     */   private static final int kKindOffset = 0;
/*     */   private static final int kElementOffset = 4;
/*     */   private static final int kDataOffset = 4;
/*     */
/*     */   XMLContent(int paramInt)
/*     */     throws QTException
/*     */   {
/*  60 */     super(paramInt, owner);
/*     */   }
/*     */
/*     */   XMLContent(int paramInt1, int paramInt2)
/*     */     throws QTException
/*     */   {
/*  70 */     super(paramInt1 + 20 * paramInt2, owner);
/*     */   }
/*     */
/*     */   int getNthIdentifier(int paramInt)
/*     */   {
/*  82 */     int i = 20 * paramInt;
/*  83 */     int j = getIntFromPointer(_ID(), i);
/*  84 */     return j;
/*     */   }
/*     */
/*     */   public int getKind()
/*     */     throws StdQTException
/*     */   {
/*  92 */     return getIntFromPointer(_ID(), 0);
/*     */   }
/*     */
/*     */   public XMLElement getElement()
/*     */     throws QTException
/*     */   {
/* 101 */     if (getKind() == 1) {
/* 102 */       int i = getIntFromPointer(_ID(), 4);
/* 103 */       return new XMLElement(i);
/*     */     }
/* 105 */     throw new StdQTException(-50);
/*     */   }
/*     */
/*     */   public String getString()
/*     */     throws StdQTException, UtilException
/*     */   {
/* 114 */     if (getKind() == 2) {
/* 115 */       int i = getIntFromPointer(_ID(), 4);
/* 116 */       return getStringFromPointer(i);
/*     */     }
/* 118 */     throw new StdQTException(-50);
/*     */   }
/*     */
/*     */   private String getStringFromPointer(int paramInt)
/*     */   {
/* 125 */     Object localObject = null;
/* 126 */     if (paramInt != 0) {
/* 127 */       int i = 0;
/* 128 */       int j = 0;
/* 129 */       while (getByteFromPointer(paramInt, j++) != 0) {
/* 130 */         i++;
/*     */       }
/* 132 */       byte[] arrayOfByte = new byte[i];
/* 133 */       copyPointerToArray(paramInt, 0, arrayOfByte, 0, i);
/* 134 */       return QTUtils.CString2String(arrayOfByte, 0);
/*     */     }
/* 136 */     return "";
/*     */   }
/*     */
/*     */   private static native byte getByteFromPointer(int paramInt1, int paramInt2);
/*     */
/*     */   private static native int getIntFromPointer(int paramInt1, int paramInt2);
/*     */
/*     */   private static native void copyPointerToArray(int paramInt1, int paramInt2, byte[] paramArrayOfByte, int paramInt3, int paramInt4);
/*     */ }

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

Related Classes of quicktime.std.qtcomponents.XMLContent

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.