Procházet zdrojové kódy

160831
Add func rautils::getdbfile

Ray Zhang před 9 roky
rodič
revize
48174e265c

binární
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 16 - 0
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -163,5 +163,21 @@
             landmarkType = "5">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/offline/SyncControlPanelViewController.m"
+            timestampString = "494322326.101264"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "127"
+            endingLineNumber = "127"
+            landmarkName = "-onSendlogClick:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 3 - 0
RedAnt ERP Mobile/common/Functions/offline/SyncControlPanelViewController.m

@@ -121,6 +121,9 @@
     
     //    if(self.attachment_name.length>0)
     //        filename = self.attachment_name;
+    
+//    data=[RAUtils getdbfile];
+//    filename=@"database.db";
     [mc addAttachmentData:data mimeType:@"text/plain" fileName:filename];
     [self presentModalViewController:mc animated:YES];
     

+ 9 - 0
RedAnt ERP Mobile/common/RAUtils.m

@@ -12,6 +12,15 @@
 #import <sys/param.h>
 #import <sys/mount.h>
 @implementation RAUtils
++(NSData*) getdbfile
+{
+    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
+    NSString *documents = /*[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];*/[paths objectAtIndex:0];
+    NSString *database_path = [documents stringByAppendingPathComponent:DBNAME];
+    return [NSData dataWithContentsOfFile:database_path];
+    
+    
+}
 +(NSDictionary*) dictfromfile:(NSString*) path
 {
     NSData *filedata = [NSData dataWithContentsOfFile:path];