C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[72164] Re:c++ builder xe7 에서 jar 파일 사용
빌더(TWx) [builder] 4666 읽음    2014-12-21 13:03
김현재 님이 쓰신 글 :
: 도저희 구글 검색을 해도 찾을수 없어 문의 드립니다.
: 우선 델파이용으로는 아래 주소를 통해서
: http://blog.hjf.pe.kr/272
: 확인할수 있는데요 아무리 봐도 이걸 c++ builder 로 변환을 어떻게 해야 될지
: 감이 서지 않습니다.
:
: 변환할 ja r 파일은 zbar.jar 파일로 바코드 관련 파일입니다. 이파일을 java2op 를 이용해서
: Androidapi.JNI.Interfaces.pas 이 파일까지 생성을 했는데요 그다음부터 어떻게 해야 되는지 감이 서지를 않습니다.
: 부디 도움좀 부탁드리겠습니다.
: 감사합니다.
:
:




답변:


#pragma once

#pragma option push
#pragma option -Vx
#pragma pack(push,8)

#include < Androidapi.JNI.JavaTypes.hpp>

namespace zBar {
namespace Jni {
namespace Interfaces {

class __declspec(delphiclass)TJzbar_Config;
class __declspec(delphiclass)TJzbar_Image;
class __declspec(delphiclass)TJImageScanner;
class __declspec(delphiclass)TJOrientation;
class __declspec(delphiclass)TJzbar_Modifier;
class __declspec(delphiclass)TJSymbol;
class __declspec(delphiclass)TJSymbolIterator;
class __declspec(delphiclass)TJSymbolSet;

struct __declspec(uuid("{B0BD188F-7AEB-418B-A2F9-DB1AC5E1685F}")) Jzbar_ConfigClass : public Androidapi::Jni::Javatypes::JObjectClass
{
    virtual int __fastcall _GetADD_CHECK(void) = 0;
    virtual int __fastcall _GetASCII(void) = 0;
    virtual int __fastcall _GetEMIT_CHECK(void) = 0;
    virtual int __fastcall _GetENABLE(void) = 0;
    virtual int __fastcall _GetMAX_LEN(void) = 0;
    virtual int __fastcall _GetMIN_LEN(void) = 0;
    virtual int __fastcall _GetPOSITION(void) = 0;
    virtual int __fastcall _GetUNCERTAINTY(void) = 0;
    virtual int __fastcall _GetX_DENSITY(void) = 0;
    virtual int __fastcall _GetY_DENSITY(void) = 0;
    __declspec(hidesbase) virtual DelphiInterface< struct Jzbar_Config> __cdecl init() = 0;
    __property int ADD_CHECK = { read = _GetADD_CHECK };
    __property int ASCII = { read = _GetASCII };
    __property int EMIT_CHECK = { read = _GetEMIT_CHECK };
    __property int ENABLE = { read = _GetENABLE };
    __property int MAX_LEN = { read = _GetMAX_LEN };
    __property int MIN_LEN = { read = _GetMIN_LEN };
    __property int POSITION = { read = _GetPOSITION };
    __property int UNCERTAINTY = { read = _GetUNCERTAINTY };
    __property int X_DENSITY = { read = _GetX_DENSITY };
    __property int Y_DENSITY = { read = _GetY_DENSITY };
};

struct __declspec(uuid("{FC0EDCC2-9410-4351-B7C5-1B202DF0A42D}")) Jzbar_Config : public Androidapi::Jni::Javatypes::JObject
{};

#pragma pack(push,4)
class __declspec(pascalimplementation)TJzbar_Config : public Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface< struct Jzbar_ConfigClass>, DelphiInterface< struct Jzbar_Config>>
{
public:
    __fastcall TJzbar_Config(void * id, void * classID, Androidapi::Jnibridge::TJavaVTable* vt) : Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface< struct Jzbar_ConfigClass>, DelphiInterface< struct Jzbar_Config>>(id, classID, vt) { }
    __fastcall virtual ~TJzbar_Config(void) { }
};

class __declspec(pascalimplementation)TJzbar_Image : public Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface< struct Jzbar_ImageClass>, DelphiInterface< struct Jzbar_Image>>
{
public:
    __fastcall TJzbar_Image(void * id, void * classID, Androidapi::Jnibridge::TJavaVTable* vt) : Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface, DelphiInterface< struct Jzbar_Image>>(id, classID, vt) { }
    __fastcall virtual ~TJzbar_Image(void) { }
};

class __declspec(pascalimplementation)TJImageScanner : public Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface< struct JImageScannerClass>, DelphiInterface< struct JImageScanner>>
{
public:
    __fastcall TJImageScanner(void * id, void * classID, Androidapi::Jnibridge::TJavaVTable* vt) : Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface< struct JImageScannerClass>, DelphiInterface< struct JImageScanner>>(id, classID, vt) { }
    __fastcall virtual ~TJImageScanner(void) { }
};

class __declspec(pascalimplementation)TJzbar_Modifier : public Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface< struct Jzbar_ModifierClass>, DelphiInterface< struct Jzbar_Modifier>>
{
public:
    __fastcall TJzbar_Modifier(void * id, void * classID, Androidapi::Jnibridge::TJavaVTable* vt) : Androidapi::Jnibridge::TJavaGenericImport__2, DelphiInterface< struct Jzbar_Modifier>>(id, classID, vt) { }
    __fastcall virtual ~TJzbar_Modifier(void) { }
};

class __declspec(pascalimplementation)TJOrientation : public Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface< struct JOrientationClass>, DelphiInterface< struct JOrientation>>
{
public:
    __fastcall TJOrientation(void * id, void * classID, Androidapi::Jnibridge::TJavaVTable* vt) : Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface< struct JOrientationClass>, DelphiInterface< struct JOrientation>>(id, classID, vt) { }
    __fastcall virtual ~TJOrientation(void) { }
};

class __declspec(pascalimplementation)TJSymbol : public Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface< struct JSymbol>, DelphiInterface< struct JSymbol>>
{
public:
    __fastcall TJSymbol(void * id, void * classID, Androidapi::Jnibridge::TJavaVTable* vt) : Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface< struct JSymbol>, DelphiInterface< struct JSymbol>>(id, classID, vt) { }
    __fastcall virtual ~TJSymbol(void) { }
};

class __declspec(pascalimplementation)TJSymbolIterator : public Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface< struct JSymbolIteratorClass>, DelphiInterface< struct JSymbolIterator>>
{
public:
    __fastcall TJSymbolIterator(void * id, void * classID, Androidapi::Jnibridge::TJavaVTable* vt) : Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface< struct JSymbolIteratorClass>, DelphiInterface< struct JSymbolIterator>>(id, classID, vt) { }
    __fastcall virtual ~TJSymbolIterator(void) { }
};

class __declspec(pascalimplementation)TJSymbolSet : public Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface< struct JSymbolSetClass>, DelphiInterface< struct JSymbolSet>>
{
public:
    __fastcall TJSymbolSet(void * id, void * classID, Androidapi::Jnibridge::TJavaVTable* vt) : Androidapi::Jnibridge::TJavaGenericImport__2< DelphiInterface, DelphiInterface< struct JSymbolSet>>(id, classID, vt) { }
    __fastcall virtual ~TJSymbolSet(void) { }
};

#pragma pack(pop)

struct __declspec(uuid("{CB3EABAD-FC2D-404A-8CB5-74437459E145}")) Jzbar_ImageClass : public Androidapi::Jni::Javatypes::JObjectClass
{
    __declspec(hidesbase)  virtual DelphiInterface< struct Jzbar_Image> __cdecl init(void) = 0;
    __declspec(hidesbase)  virtual DelphiInterface< struct Jzbar_Image> __cdecl init(Androidapi::Jni::Javatypes::_di_JString js) = 0;
    __declspec(hidesbase)  virtual DelphiInterface< struct Jzbar_Image> __cdecl init(int P1, int P2) = 0;
    __declspec(hidesbase)  virtual DelphiInterface< struct Jzbar_Image> __cdecl init(int P1, int P2, Androidapi::Jni::Javatypes::_di_JString js) = 0;
};

struct __declspec(uuid("{2EA5EBFE-668A-424A-8D46-A9977F9041A4}")) Jzbar_Image : public Androidapi::Jni::Javatypes::JObject
{
    virtual DelphiInterface< struct Jzbar_Image> __cdecl convert(Androidapi::Jni::Javatypes::_di_JString js) = 0;
    virtual void __cdecl destroy(void) = 0;
    virtual Androidapi::Jnibridge::TJavaArray__1 * __cdecl getCrop(void) = 0;
    virtual Androidapi::Jnibridge::TJavaArray__1 * __cdecl getData(void) = 0;
    virtual Androidapi::Jni::Javatypes::_di_JString __cdecl getFormat(void) = 0;
    virtual int __cdecl getHeight(void) = 0;
    virtual int __cdecl getSequence(void) = 0;
    virtual Androidapi::Jnibridge::TJavaArray__1 * __cdecl getSize(void) = 0;
    virtual DelphiInterface< struct JSymbolSet> __cdecl getSymbols(void) = 0;
    virtual int __cdecl getWidth(void) = 0;
    virtual void __cdecl setCrop(Androidapi::Jnibridge::TJavaArray__1 *) = 0;
    virtual void __cdecl setCrop(int P1, int P2, int P3, int P4) = 0;
    virtual void __cdecl setData(Androidapi::Jnibridge::TJavaArray__1 *) = 0;
    virtual void __cdecl setData(Androidapi::Jnibridge::TJavaArray__1 *) = 0;
    virtual void __cdecl setFormat(Androidapi::Jni::Javatypes::_di_JString js) = 0;
    virtual void __cdecl setSequence(int P1) = 0;
    virtual void __cdecl setSize(Androidapi::Jnibridge::TJavaArray__1 * ) = 0;
    virtual void __cdecl setSize(int P1, int P2) = 0;
};

struct __declspec(uuid("{F36557E4-F86D-4526-9007-620BBA6692D1}")) JImageScannerClass : public Androidapi::Jni::Javatypes::JObjectClass
{
    __declspec(hidesbase) virtual DelphiInterface< struct JImageScanner> __cdecl init(void) = 0;
};

struct __declspec(uuid("{A48FB367-8B5F-4E22-857F-9FD295B62B8E}")) JImageScanner : public Androidapi::Jni::Javatypes::JObject
{
    virtual void __cdecl destroy(void) = 0;
    virtual void __cdecl enableCache(bool) = 0;
    virtual DelphiInterface< struct JSymbolSet> __cdecl getResults(void) = 0;
    virtual void __cdecl parseConfig(Androidapi::Jni::Javatypes::_di_JString js) = 0;
    virtual int __cdecl scanImage(DelphiInterface< struct Jzbar_Image> zi) = 0;
    virtual void __cdecl setConfig(int, int, int) = 0;
};

struct __declspec(uuid("{08807AA6-BBBE-48EE-B3AC-75BB2A97086D}")) Jzbar_ModifierClass : public Androidapi::Jni::Javatypes::JObjectClass
{
    virtual int __fastcall _GetAIM(void) = 0;
    virtual int __fastcall _GetGS1(void) = 0;
    __declspec(hidesbase) virtual DelphiInterface< struct Jzbar_Modifier> __cdecl init(void) = 0;
    __property int AIM = { read = _GetAIM };
    __property int GS1 = { read = _GetGS1 };
};

struct __declspec(uuid("{6AC8C074-6B46-47EF-933F-94E6A4A61D4A}")) Jzbar_Modifier : public Androidapi::Jni::Javatypes::JObject
{
};

struct __declspec(uuid("{B7385A1F-A400-4797-9D23-1805ECB34974}")) JOrientationClass : public Androidapi::Jni::Javatypes::JObjectClass
{
    virtual int __fastcall _GetDOWN(void) = 0;
    virtual int __fastcall _GetLEFT(void) = 0;
    virtual int __fastcall _GetRIGHT(void) = 0;
    virtual int __fastcall _GetUNKNOWN(void) = 0;
    virtual int __fastcall _GetUP(void) = 0;
    __declspec(hidesbase) virtual DelphiInterface< struct JOrientation> __cdecl init(void) = 0;
    __property int DOWN = { read = _GetDOWN };
    __property int LEFT = { read = _GetLEFT };
    __property int RIGHT = { read = _GetRIGHT };
    __property int UNKNOWN = { read = _GetUNKNOWN };
    __property int UP = { read = _GetUP };
};

struct __declspec(uuid("{E2EBB686-68E7-4977-95F1-D5D85A04334D}")) JOrientation : public Androidapi::Jni::Javatypes::JObject
{
};

struct __declspec(uuid("{FBA6D14F-D082-4461-8DEB-4C61C673212E}")) JSymbolClass : public Androidapi::Jni::Javatypes::JObjectClass
{
    virtual int __fastcall _GetCODABAR(void) = 0;
    virtual int __fastcall _GetCODE128(void) = 0;
    virtual int __fastcall _GetCODE39(void) = 0;
    virtual int __fastcall _GetCODE93(void) = 0;
    virtual int __fastcall _GetDATABAR(void) = 0;
    virtual int __fastcall _GetDATABAR_EXP(void) = 0;
    virtual int __fastcall _GetEAN13(void) = 0;
    virtual int __fastcall _GetEAN8(void) = 0;
    virtual int __fastcall _GetI25(void) = 0;
    virtual int __fastcall _GetISBN10(void) = 0;
    virtual int __fastcall _GetISBN13(void) = 0;
    virtual int __fastcall _GetNONE(void) = 0;
    virtual int __fastcall _GetPARTIAL(void) = 0;
    virtual int __fastcall _GetPDF417(void) = 0;
    virtual int __fastcall _GetQRCODE(void) = 0;
    virtual int __fastcall _GetUPCA(void) = 0;
    virtual int __fastcall _GetUPCE(void) = 0;
    __property int CODABAR = { read = _GetCODABAR };
    __property int CODE128 = { read = _GetCODE128 };
    __property int CODE39 = { read = _GetCODE39 };
    __property int CODE93 = { read = _GetCODE93 };
    __property int DATABAR = { read = _GetDATABAR };
    __property int DATABAR_EXP = { read = _GetDATABAR_EXP };
    __property int EAN13 = { read = _GetEAN13 };
    __property int EAN8 = { read = _GetEAN8 };
    __property int I25 = { read = _GetI25 };
    __property int ISBN10 = { read = _GetISBN10 };
    __property int ISBN13 = { read = _GetISBN13 };
    __property int NONE = { read = _GetNONE };
    __property int PARTIAL = { read = _GetPARTIAL };
    __property int PDF417 = { read = _GetPDF417 };
    __property int QRCODE = { read = _GetQRCODE };
    __property int UPCA = { read = _GetUPCA };
    __property int UPCE = { read = _GetUPCE };
};

struct __declspec(uuid("{51D7EDEB-638B-44DC-A24C-6150D08F7D5E}")) JSymbol : public Androidapi::Jni::Javatypes::JObject
{
    virtual void __cdecl destroy(void) = 0;
    virtual Androidapi::Jnibridge::TJavaArray__1 * __cdecl getBounds(void) = 0;
    virtual DelphiInterface< struct JSymbolSet> __cdecl getComponents(void) = 0;
    virtual int __cdecl getConfigMask(void) = 0;
    virtual int __cdecl getCount(void) = 0;
    virtual Androidapi::Jni::Javatypes::_di_JString __cdecl getData(void) = 0;
    virtual Androidapi::Jnibridge::TJavaArray__1 * __cdecl getDataBytes(void) = 0;
    virtual Androidapi::Jnibridge::TJavaArray__1 * __cdecl getLocationPoint(int) = 0;
    virtual int __cdecl getModifierMask(void) = 0;
    virtual int __cdecl getOrientation(void) = 0;
    virtual int __cdecl getQuality(void) = 0;
    virtual int __cdecl getType(void) = 0;
};

struct __declspec(uuid("{6FDDAB46-1EC0-419E-BCA2-10905A104336}")) JSymbolIteratorClass : public Androidapi::Jni::Javatypes::JObjectClass
{
};

struct __declspec(uuid("{AC194045-E48F-465E-975F-56F04C5F3267}")) JSymbolIterator : public Androidapi::Jni::Javatypes::JObject
{
    virtual bool __cdecl hasNext(void) = 0;
    virtual DelphiInterface< struct JSymbol> __cdecl next(void) = 0;
    virtual void __cdecl remove(void) = 0;
};

struct __declspec(uuid("{324B9B68-A460-4E25-8EF9-A19E71DE6E62}")) JSymbolSetClass : public Androidapi::Jni::Javatypes::JAbstractCollectionClass
{
};

struct __declspec(uuid("{5CD1D332-EACB-46D9-9D22-8115A237497C}")) JSymbolSet : public Androidapi::Jni::Javatypes::JAbstractCollection
{
    virtual void __cdecl destroy(void) = 0;
    __declspec(hidesbase) virtual Androidapi::Jni::Javatypes::_di_JIterator __cdecl iterator(void) = 0;
    __declspec(hidesbase) virtual int __cdecl size(void) = 0;
};


}}}

#pragma pack(pop)
#pragma option pop





Type Safety와 거리가 먼 Jave Script 언어를 Java와 같은 언어로 생각하고 '자바 코드는 날코드다'라고 황당한 얘기를 하는
사람들도 많은 것 같은데... Java와 Java Script는 전혀 별개의 언어이고, C++의 장점만 추려서 간결하게 만든 언어가 Java죠.
안드로이드 플렛폼은 Java를 이용해서 개발하는 게 가장 최적임에도 불구하고 굳이 C++빌더를 이용하려는 의도가 이해가 안가네요.

C++랭귀지를 마스터 하고 있으면 Java 랭귀지는 특별히 따로 시간을 투자하지 않더라도 쉽게 다룰 수 있을텐데요.

java <---> Delphi pascal <---> c++ builder

VCL, FireMonkey 등 라이브러리가 파스칼로 만들어 졌기 때문에... COM, Interface, WebBrowser, Android 등 을 C++로
코딩하려면 더 번거로울 텐데요. 안드로이드를 C++ Builder로 코딩한다고 해서 더 빠를 거라는 환상은 갖지 마세요.
'native'라는 나무만 보면, 안드로이드 프레임웍 전체 숲을 보지 못하는 결과를 초래하게 될 겁니다.




+ -

관련 글 리스트
72162 c++ builder xe7 에서 jar 파일 사용 김현재 4255 2014/12/20
72164     Re:c++ builder xe7 에서 jar 파일 사용 빌더(TWx) 4666 2014/12/21
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.