4 * Copyright (File::*c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
8 * Jaewon Lim <jaewon81.lim@samsung.com>
9 * Woojin Jung <woojin2.jung@samsung.com>
10 * Juyoung Kim <j0.kim@samsung.com>
11 * Anastasia Lyupa <a.lyupa@samsung.com>
13 * This library is free software; you can redistribute it and/or modify it under
14 * the terms of the GNU Lesser General Public License as published by the
15 * Free Software Foundation; either version 2.1 of the License, or (at your option)
18 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
19 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
21 * License for more details.
23 * You should have received a copy of the GNU Lesser General Public License
24 * along with this library; if not, write to the Free Software Foundation, Inc., 51
25 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29 * - Samsung RnD Institute Russia
34 #include <linux/limits.h>
36 #include "probeinfo.h"
41 static enum DaOptions _sopt = OPT_FILE;
46 result File::Construct(const Tizen::Base::String& filePath,
47 const Tizen::Base::String& openMode, bool createParentDirectories) {
48 typedef result (File::*methodType)(const Tizen::Base::String& filePath,
49 const Tizen::Base::String& openMode, bool createParentDirectories);
50 static methodType Constructp = 0;
52 probeInfo_t probeInfo;
54 bool bfiltering = true;
62 void *tmpPtr = dlsym(RTLD_NEXT,
63 "_ZN5Tizen2Io4File9ConstructERKNS_4Base6StringES5_b");
65 if (tmpPtr == NULL || dlerror() != NULL) {
66 perror("dlsym failed : Tizen::Io::File::Construct");
70 memcpy(&Constructp, &tmpPtr, sizeof(tmpPtr));
74 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
75 setProbePoint(&probeInfo);
79 ret = (this->*Constructp)(filePath, openMode, createParentDirectories);
81 if(postBlockBegin(blockresult)) {
82 char buffer[PATH_MAX];
84 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
85 size = attr.GetFileSize();
86 WcharToChar(temp_path,filePath.GetPointer());
87 WcharToChar(temp_mode,openMode.GetPointer());
90 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID_result_File__Construct_const_Tizen__Base__String__filePath__const_Tizen__Base__String__openMode__bool_createParentDirectories_,
91 "ssd", absolutize_filepath(buffer,temp_path),
92 temp_mode, createParentDirectories);
93 PACK_COMMON_END('p', ret, ret, blockresult);
94 PACK_RESOURCE(0, (unsigned long)this, FD_API_OPEN, size, temp_path);
103 result File::Construct(const Tizen::Base::String& filePath,
104 const Tizen::Base::String& openMode) {
105 typedef result (File::*methodType)(const Tizen::Base::String& filePath,
106 const Tizen::Base::String& openMode);
107 static methodType Constructp = 0;
109 probeInfo_t probeInfo;
111 bool bfiltering = true;
119 void *tmpPtr = dlsym(RTLD_NEXT,
120 "_ZN5Tizen2Io4File9ConstructERKNS_4Base6StringES5_");
122 if(tmpPtr == NULL || dlerror() != NULL) {
123 perror("dlsym failed : Tizen::Io::File::Construct");
127 memcpy(&Constructp, &tmpPtr, sizeof(tmpPtr));
131 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
132 setProbePoint(&probeInfo);
136 ret = (this->*Constructp)(filePath, openMode);
138 if(postBlockBegin(blockresult)) {
139 char buffer[PATH_MAX];
141 WcharToChar(temp_path,filePath.GetPointer());
142 WcharToChar(temp_mode,openMode.GetPointer());
143 // Comment this because of fault during Internet application profiling
144 // (it closes unexpectedly) but for DATizenTestApp it is ok
145 // There is the same problem at File::~File(void)
146 //if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
147 // size = attr.GetFileSize();
150 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
151 API_ID_result_File__Construct_const_Tizen__Base__String__filePath__const_Tizen__Base__String__openMode_,
152 "ss", absolutize_filepath(buffer, temp_path), temp_mode);
153 PACK_COMMON_END('p', ret, ret, blockresult);
154 PACK_RESOURCE(0, (unsigned long)this, FD_API_OPEN, size, temp_path);
163 result File::Construct(const Tizen::Base::String& filePath,
164 const char *pOpenMode) {
165 typedef result (File::*methodType)(const Tizen::Base::String& filePath,
166 const char *pOpenMode);
167 static methodType Constructp = 0;
169 probeInfo_t probeInfo;
171 bool bfiltering = true;
178 void *tmpPtr = dlsym(RTLD_NEXT,
179 "_ZN5Tizen2Io4File9ConstructERKNS_4Base6StringEPKc");
181 if(tmpPtr == NULL || dlerror() != NULL) {
182 perror("dlsym failed : Tizen::Io::File::Construct");
186 memcpy(&Constructp, &tmpPtr, sizeof(tmpPtr));
190 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
191 setProbePoint(&probeInfo);
195 ret = (this->*Constructp)(filePath, pOpenMode);
197 if(postBlockBegin(blockresult)) {
198 char buffer[PATH_MAX];
200 WcharToChar(temp,filePath.GetPointer());
201 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
202 size = attr.GetFileSize();
205 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
206 API_ID_result_File__Construct_const_Tizen__Base__String__filePath__const_char__pOpenMode_,
207 "sp", absolutize_filepath(buffer, temp),
208 voidp_to_uint64(pOpenMode));
209 PACK_COMMON_END('p', ret, ret, blockresult);
210 PACK_RESOURCE(0, (unsigned long)this, FD_API_OPEN, size, temp);
219 result File::Construct(const Tizen::Base::String& filePath,
220 const char *pOpenMode,
221 const Tizen::Base::ByteBuffer& secretKey) {
222 typedef result (File::*methodType)(const Tizen::Base::String& filePath,
223 const char *pOpenMode,
224 const Tizen::Base::ByteBuffer& secretKey);
225 static methodType Constructp = 0;
227 probeInfo_t probeInfo;
229 bool bfiltering = true;
237 void *tmpPtr = dlsym(RTLD_NEXT,
238 "_ZN5Tizen2Io4File9ConstructERKNS_4Base6StringEPKcRKNS2_10ByteBufferE");
240 if(tmpPtr == NULL || dlerror() != NULL) {
241 perror("dlsym failed : Tizen::Io::File::Construct");
245 memcpy(&Constructp, &tmpPtr, sizeof(tmpPtr));
249 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
250 setProbePoint(&probeInfo);
254 ret = (this->*Constructp)(filePath, pOpenMode, secretKey);
256 if(postBlockBegin(blockresult)) {
257 WcharToChar(temp,filePath.GetPointer());
258 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
259 size = attr.GetFileSize();
262 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
263 API_ID_result_File__Construct_const_Tizen__Base__String__filePath__const_char__pOpenMode__const_Tizen__Base__ByteBuffer__secretKey_,
265 voidp_to_uint64(pOpenMode));
266 PACK_COMMON_END('p', ret, ret, blockresult);
267 PACK_RESOURCE(0, (unsigned long)this, FD_API_OPEN, size, temp);
276 result File::Flush(void) {
277 typedef result (File::*methodType)(void);
278 static methodType Flushp = 0;
280 probeInfo_t probeInfo;
282 bool bfiltering = true;
290 void *tmpPtr = dlsym(RTLD_NEXT, "_ZN5Tizen2Io4File5FlushEv");
292 if (tmpPtr == NULL || dlerror() != NULL) {
293 perror("dlsym failed : Tizen::Io::File::Flush");
297 memcpy(&Flushp, &tmpPtr, sizeof(tmpPtr));
301 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
302 setProbePoint(&probeInfo);
306 ret = (this->*Flushp)();
308 if(postBlockBegin(blockresult)) {
309 WcharToChar(temp,this->GetName().GetPointer());
310 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
311 size = attr.GetFileSize();
314 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
315 API_ID_result_File__Flush_void_,
317 PACK_COMMON_END('p', ret, ret, blockresult);
318 PACK_RESOURCE(0, (unsigned long)this, FD_API_OTHER, size, temp);
327 Tizen::Base::String File::GetName(void) const{
328 typedef Tizen::Base::String (File::*methodType)(void) const;
329 static methodType GetNamep = 0;
330 Tizen::Base::String ret;
331 probeInfo_t probeInfo;
333 bool bfiltering = true;
341 void *tmpPtr = dlsym(RTLD_NEXT, "_ZNK5Tizen2Io4File7GetNameEv");
343 if (tmpPtr == NULL || dlerror() != NULL) {
344 perror("dlsym failed : Tizen::Io::File::GetName");
348 memcpy(&GetNamep, &tmpPtr, sizeof(tmpPtr));
352 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
353 setProbePoint(&probeInfo);
357 ret = (this->*GetNamep)();
358 result res = GetLastResult();
360 if(postBlockBegin(blockresult)) {
361 WcharToChar(temp,ret.GetPointer());
362 if (E_SUCCESS == File::GetAttributes(this->GetName(), attr))
363 size = attr.GetFileSize();
366 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
367 API_ID_Tizen__Base__String_File__GetName_void__const,
369 PACK_COMMON_END('p', ret.GetPointer(), res, blockresult);
370 PACK_RESOURCE(0, (unsigned long)this, FD_API_OTHER, size, temp);
379 result File::Read(Tizen::Base::String& buffer) {
380 typedef result (File::*methodType)(Tizen::Base::String & buffer);
381 static methodType Readp = 0;
383 probeInfo_t probeInfo;
385 bool bfiltering = true;
394 void *tmpPtr = dlsym(RTLD_NEXT,
395 "_ZN5Tizen2Io4File4ReadERNS_4Base6StringE");
397 if (tmpPtr == NULL || dlerror() != NULL) {
398 perror("dlsym failed : Tizen::Io::File::Read");
402 memcpy(&Readp, &tmpPtr, sizeof(tmpPtr));
406 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
407 setProbePoint(&probeInfo);
408 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
409 size = attr.GetFileSize();
410 WcharToChar(temp, this->GetName().GetPointer());
413 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
414 API_ID_result_File__Read_Tizen__Base__String__buffer_,
415 "x", (uint64_t)(&buffer));
416 PACK_COMMON_END('p', 0, 0, blockresult);
417 PACK_RESOURCE(0, (unsigned long)this, FD_API_READ_START, size, temp);
423 ret = (this->*Readp)(buffer);
425 if(postBlockBegin(blockresult)) {
426 setProbePoint(&probeInfo);
427 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
428 size = attr.GetFileSize();
429 WcharToChar(temp, this->GetName().GetPointer());
430 nRead = buffer.GetLength();
433 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
434 API_ID_result_File__Read_Tizen__Base__String__buffer_,
435 "x", (uint64_t)(&buffer));
436 PACK_COMMON_END('p', ret, ret, blockresult);
437 PACK_RESOURCE(nRead, (unsigned long)this, FD_API_READ_END, size, temp);
446 result File::Read(Tizen::Base::ByteBuffer& buffer) {
447 typedef result (File::*methodType)(Tizen::Base::ByteBuffer & buffer);
448 static methodType Readp = 0;
450 probeInfo_t probeInfo;
452 bool bfiltering = true;
461 void *tmpPtr = dlsym(RTLD_NEXT,
462 "_ZN5Tizen2Io4File4ReadERNS_4Base10ByteBufferE");
464 if (tmpPtr == NULL || dlerror() != NULL) {
465 perror("dlsym failed : Tizen::Io::File::Read");
469 memcpy(&Readp, &tmpPtr, sizeof(tmpPtr));
473 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
474 setProbePoint(&probeInfo);
475 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
476 size = attr.GetFileSize();
477 WcharToChar(temp, this->GetName().GetPointer());
480 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
481 API_ID_result_File__Read_Tizen__Base__ByteBuffer__buffer_,
482 "x", (uint64_t)(&buffer));
483 PACK_COMMON_END('p', 0, 0, blockresult);
484 PACK_RESOURCE(0, (unsigned long)this, FD_API_READ_START, size, temp);
490 ret = (this->*Readp)(buffer);
492 if(postBlockBegin(blockresult)) {
493 setProbePoint(&probeInfo);
494 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
495 size = attr.GetFileSize();
496 WcharToChar(temp, this->GetName().GetPointer());
497 buffer.GetInt(nRead);
500 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
501 API_ID_result_File__Read_Tizen__Base__ByteBuffer__buffer_,
502 "x", (uint64_t)(&buffer));
503 PACK_COMMON_END('p', ret, ret, blockresult);
504 PACK_RESOURCE(nRead, (unsigned long)this, FD_API_READ_END, size, temp);
513 int File::Read(void *buffer, int length) {
514 typedef int (File::*methodType)(void *buffer, int length);
515 static methodType Readp = 0;
517 probeInfo_t probeInfo;
519 bool bfiltering = true;
528 void *tmpPtr = dlsym(RTLD_NEXT, "_ZN5Tizen2Io4File4ReadEPvi");
530 if (tmpPtr == NULL || dlerror() != NULL) {
531 perror("dlsym failed : Tizen::Io::File::Read");
535 memcpy(&Readp, &tmpPtr, sizeof(tmpPtr));
539 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
540 setProbePoint(&probeInfo);
542 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
543 size = attr.GetFileSize();
544 WcharToChar(temp, this->GetName().GetPointer());
547 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
548 API_ID_int_File__Read_void__buffer__int_length_,
549 "xd", (uint64_t)(buffer), length);
550 PACK_COMMON_END('p', 0, 0, blockresult);
551 PACK_RESOURCE(0, (unsigned long)this, FD_API_READ_START, size, temp);
557 ret = (this->*Readp)(buffer, length);
558 result res = GetLastResult();
560 if(postBlockBegin(blockresult)) {
561 setProbePoint(&probeInfo);
562 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
563 size = attr.GetFileSize();
564 WcharToChar(temp, this->GetName().GetPointer());
565 nRead = Tell() - nRead;
568 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
569 API_ID_int_File__Read_void__buffer__int_length_,
570 "xd", (uint64_t)(buffer), length);
571 PACK_COMMON_END('p', ret, res, blockresult);
572 PACK_RESOURCE(nRead, (unsigned long)this, FD_API_READ_END, size, temp);
581 result File::Seek(FileSeekPosition position, long offset) {
582 typedef result (File::*methodType)(FileSeekPosition position, long offset);
583 static methodType Seekp = 0;
585 probeInfo_t probeInfo;
587 bool bfiltering = true;
596 void *tmpPtr = dlsym(RTLD_NEXT,
597 "_ZN5Tizen2Io4File4SeekENS0_16FileSeekPositionEl");
599 if (tmpPtr == NULL || dlerror() != NULL) {
600 perror("dlsym failed : Tizen::Io::File::Seek");
604 memcpy(&Seekp, &tmpPtr, sizeof(tmpPtr));
609 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
610 setProbePoint(&probeInfo);
614 ret = (this->*Seekp)(position, offset);
616 if(postBlockBegin(blockresult)) {
618 if(FILESEEKPOSITION_BEGIN == position)
619 strcpy(temp_pos, "FILESEEKPOSITION_BEGIN");
620 else if(FILESEEKPOSITION_CURRENT == position)
621 strcpy(temp_pos, "FILESEEKPOSITION_CURRENT");
622 else if(FILESEEKPOSITION_END == position)
623 strcpy(temp_pos, "FILESEEKPOSITION_END");
626 sprintf(temp_pos, "%d", position);
628 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
629 size = attr.GetFileSize();
630 WcharToChar(temp, this->GetName().GetPointer());
633 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
634 API_ID_result_File__Seek_FileSeekPosition_position__long_offset_,
635 "sx", temp_pos, (uint64_t)(offset));
636 PACK_COMMON_END('p', ret, ret, blockresult);
637 PACK_RESOURCE(0, (unsigned long)this, FD_API_OTHER, size, temp);
646 int File::Tell(void) const {
647 typedef int (File::*methodType)(void) const;
648 static methodType Tellp = 0;
650 probeInfo_t probeInfo;
652 bool bfiltering = true;
660 void *tmpPtr = dlsym(RTLD_NEXT, "_ZNK5Tizen2Io4File4TellEv");
662 if (tmpPtr == NULL || dlerror() != NULL) {
663 perror("dlsym failed : Tizen::Io::File::Tell");
667 memcpy(&Tellp, &tmpPtr, sizeof(tmpPtr));
672 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
673 setProbePoint(&probeInfo);
677 ret = (this->*Tellp)();
678 result res = GetLastResult();
680 if(postBlockBegin(blockresult)) {
681 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
682 size = attr.GetFileSize();
683 WcharToChar(temp,this->GetName().GetPointer());
686 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
687 API_ID_int_File__Tell_void__const,
689 PACK_COMMON_END('p', ret, res, blockresult);
690 PACK_RESOURCE(0, (unsigned long)this, FD_API_OTHER, size, temp);
699 result File::Truncate(int length) {
700 typedef result (File::*methodType)(int length);
701 static methodType Truncatep = 0;
703 probeInfo_t probeInfo;
705 bool bfiltering = true;
713 void *tmpPtr = dlsym(RTLD_NEXT, "_ZN5Tizen2Io4File8TruncateEi");
715 if (tmpPtr == NULL || dlerror() != NULL) {
716 perror("dlsym failed : Tizen::Io::File::Truncate");
720 memcpy(&Truncatep, &tmpPtr, sizeof(tmpPtr));
724 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
725 setProbePoint(&probeInfo);
729 ret = (this->*Truncatep)(length);
731 if(postBlockBegin(blockresult)) {
732 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
733 size = attr.GetFileSize();
734 WcharToChar(temp,this->GetName().GetPointer());
737 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
738 API_ID_result_File__Truncate_int_length_,
740 PACK_COMMON_END('p', ret, ret, blockresult);
741 PACK_RESOURCE(0, (unsigned long)this, FD_API_OTHER, size, temp);
750 result File::Write(const void *buffer, int length) {
751 typedef result (File::*methodType)(const void *buffer, int length);
752 static methodType Writep = 0;
754 probeInfo_t probeInfo;
756 bool bfiltering = true;
765 void *tmpPtr = dlsym(RTLD_NEXT, "_ZN5Tizen2Io4File5WriteEPKvi");
767 if (tmpPtr == NULL || dlerror() != NULL) {
768 perror("dlsym failed : Tizen::Io::File::Write");
772 memcpy(&Writep, &tmpPtr, sizeof(tmpPtr));
776 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
777 setProbePoint(&probeInfo);
779 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
780 size = attr.GetFileSize();
781 WcharToChar(temp, this->GetName().GetPointer());
784 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
785 API_ID_result_File__Write_const_void__buffer__int_length_,
786 "xd", (uint64_t)(buffer), length);
787 PACK_COMMON_END('p', 0, 0, blockresult);
788 PACK_RESOURCE(0, (unsigned long)this, FD_API_WRITE_START, size, temp);
794 ret = (this->*Writep)(buffer, length);
796 if(postBlockBegin(blockresult)) {
797 setProbePoint(&probeInfo);
798 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
799 size = attr.GetFileSize();
800 WcharToChar(temp, this->GetName().GetPointer());
801 nWritten = Tell() - nWritten;
804 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
805 API_ID_result_File__Write_const_void__buffer__int_length_,
806 "xd", (uint64_t)(buffer), length);
807 PACK_COMMON_END('p', ret, ret, blockresult);
808 PACK_RESOURCE(nWritten, (unsigned long)this, FD_API_WRITE_END, size, temp);
817 result File::Write(const Tizen::Base::ByteBuffer& buffer) {
818 typedef result (File::*methodType)(const Tizen::Base::ByteBuffer& buffer);
819 static methodType Writep = 0;
821 probeInfo_t probeInfo;
823 bool bfiltering = true;
832 void *tmpPtr = dlsym(RTLD_NEXT, "_ZN5Tizen2Io4File5WriteERKNS_4Base10ByteBufferE");
834 if (tmpPtr == NULL || dlerror() != NULL) {
835 perror("dlsym failed : Tizen::Io::File::Write");
839 memcpy(&Writep, &tmpPtr, sizeof(tmpPtr));
843 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
844 setProbePoint(&probeInfo);
846 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
847 size = attr.GetFileSize();
848 WcharToChar(temp,this->GetName().GetPointer());
851 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
852 API_ID_result_File__Write_const_Tizen__Base__ByteBuffer__buffer_,
853 "x", (uint64_t)(&buffer));
854 PACK_COMMON_END('p', 0, 0, blockresult);
855 PACK_RESOURCE(0, (unsigned long)this, FD_API_WRITE_START, size, temp);
861 ret = (this->*Writep)(buffer);
863 if(postBlockBegin(blockresult)) {
864 setProbePoint(&probeInfo);
865 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
866 size = attr.GetFileSize();
867 WcharToChar(temp,this->GetName().GetPointer());
868 nWritten = Tell() - nWritten;
871 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
872 API_ID_result_File__Write_const_Tizen__Base__ByteBuffer__buffer_,
873 "x", (uint64_t)(&buffer));
874 PACK_COMMON_END('p', ret, ret, blockresult);
875 PACK_RESOURCE(nWritten, (unsigned long)this, FD_API_WRITE_END, size, temp);
884 result File::Write(const Tizen::Base::String& buffer) {
885 typedef result (File::*methodType)(const Tizen::Base::String& buffer);
886 static methodType Writep = 0;
888 probeInfo_t probeInfo;
890 bool bfiltering = true;
900 void *tmpPtr = dlsym(RTLD_NEXT, "_ZN5Tizen2Io4File5WriteERKNS_4Base6StringE");
902 if (tmpPtr == NULL || dlerror() != NULL) {
903 perror("dlsym failed : Tizen::Io::File::Write");
907 memcpy(&Writep, &tmpPtr, sizeof(tmpPtr));
911 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
912 setProbePoint(&probeInfo);
914 WcharToChar(temp_buf, buffer.GetPointer());
915 if(E_SUCCESS == File::GetAttributes(this->GetName(), attr))
916 size = attr.GetFileSize();
917 WcharToChar(temp_path, this->GetName().GetPointer());
920 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
921 API_ID_result_File__Write_const_Tizen__Base__String__buffer_,
923 PACK_COMMON_END('p', 0, 0, blockresult);
924 PACK_RESOURCE(0, (unsigned long)this, FD_API_WRITE_START, size, temp_path);
930 ret = (this->*Writep)(buffer);
932 if(postBlockBegin(blockresult)) {
933 setProbePoint(&probeInfo);
934 WcharToChar(temp_buf,buffer.GetPointer());
935 WcharToChar(temp_path,this->GetName().GetPointer());
936 nWritten = Tell() - nWritten;
937 if(E_SUCCESS == File::GetAttributes(this->GetName(),attr))
938 size = attr.GetFileSize();
939 nWritten = Tell() - nWritten;
942 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
943 API_ID_result_File__Write_const_Tizen__Base__String__buffer_,
945 PACK_COMMON_END('p', ret, ret, blockresult);
946 PACK_RESOURCE(nWritten, (unsigned long)this, FD_API_WRITE_END, size, temp_path);
955 typedef void (File::*methodType)();
956 static methodType FileDp = 0;
957 probeInfo_t probeInfo;
959 bool bfiltering = true;
961 // FileAttributes attr;
967 tmpPtr = dlsym(RTLD_NEXT, "_ZN5Tizen2Io4FileD1Ev");
969 if (tmpPtr == NULL || dlerror() != NULL) {
970 perror("dlsym failed : Tizen::Io::File::~File");
974 memcpy(&FileDp, &tmpPtr, sizeof(tmpPtr));
978 if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
979 setProbePoint(&probeInfo);
980 // error occur if File class was failed to contruct
981 // if (ret == E_SUCCESS &&
982 // E_SUCCESS == File::GetAttributes(this->GetName(), attr))
983 // size = attr.GetFileSize();
989 if(postBlockBegin(blockresult)) {
992 PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
993 API_ID_File___File_void_,
995 PACK_COMMON_END('p', 0, 0, blockresult);
996 PACK_RESOURCE(0, (unsigned long)this, FD_API_CLOSE, size, "");
1005 //static result File::ConvertToSecureFile(const Tizen::Base::String &plainFilePath,
1006 // const Tizen::Base::String &secureFilePath) {
1007 // typedef result (File::*methodType)(
1008 // const Tizen::Base::String &plainFilePath,
1009 // const Tizen::Base::String &secureFilePath);
1010 // static methodType ConvertToSecureFilep = 0;
1013 //static result File::ConvertToSecureFile(const Tizen::Base::String &plainFilePath,
1014 // const Tizen::Base::String &secureFilePath,
1015 // const Tizen::Base::ByteBuffer& key) {
1016 // typedef result (File::*methodType)(
1017 // const Tizen::Base::String &plainFilePath,
1018 // const Tizen::Base::String &secureFilePath,
1019 // const Tizen::Base::ByteBuffer& key);
1020 // static methodType ConvertToSecureFilep = 0;
1023 //static result File::Copy(const Tizen::Base::String& srcFilePath,
1024 // const Tizen::Base::String& destFilePath, bool failIfExist) {
1025 // typedef result (File::*methodType)(const Tizen::Base::String& srcFilePath,
1026 // const Tizen::Base::String& destFilePath, bool failIfExist);
1027 // static methodType Copyp = 0;
1030 //static result File::GetAttributes(const Tizen::Base::String& filePath,
1031 // FileAttributes& attribute) {
1032 // typedef result (File::*methodType)(const Tizen::Base::String& filePath,
1033 // FileAttributes& attribute);
1034 // static methodType GetAttributesp = 0;
1037 //static const Tizen::Base::String File::GetFileExtension(
1038 // const Tizen::Base::String& filePath) {
1039 // typedef const Tizen::Base::String (File::*methodType)(
1040 // const Tizen::Base::String& filePath);
1041 // static methodType GetFileExtensionp = 0;
1044 //const Tizen::Base::String File::GetFileName(
1045 // const Tizen::Base::String& filePath) {
1046 // typedef const Tizen::Base::String (File::*methodType)(
1047 // const Tizen::Base::String& filePath);
1048 // static methodType GetFileNamep = 0;
1049 // Tizen::Base::String ret;
1051 // if (!GetFileNamep) {
1052 // probeBlockStart();
1053 // void *tmpPtr = dlsym(RTLD_NEXT,
1054 // "_ZN5Tizen2Io4File11GetFileNameERKNS_4Base6StringE");
1056 // if (tmpPtr == NULL || dlerror() != NULL) {
1057 // perror("dlsym failed : Tizen::Io::File::GetFileName");
1061 // memcpy(&GetFileNamep, &tmpPtr, sizeof(tmpPtr));
1064 // ret = (File::(*GetFileNamep))(filePath);
1068 //static bool File::IsEncrypted(const Tizen::Base::String &filePath) {
1069 // typedef bool (File::*methodType)(const Tizen::Base::String &filePath);
1070 // static methodType IsEncryptedp = 0;
1073 //static bool File::IsFileExist(const Tizen::Base::String& filePath) {
1074 // typedef bool (File::*methodType)(const Tizen::Base::String& filePath);
1075 // static methodType IsFileExistp = 0;
1078 //static result File::Move(const Tizen::Base::String& oldFilePath,
1079 // const Tizen::Base::String& newFilePath) {
1080 // typedef result (File::*methodType)(const Tizen::Base::String& oldFilePath,
1081 // const Tizen::Base::String& newFilePath);
1082 // static methodType Movep = 0;
1085 //static result File::Remove(const Tizen::Base::String& filePath) {
1086 // typedef result (File::*methodType)(const Tizen::Base::String& filePath);
1087 // static methodType Removep = 0;