[vlc-commits] commit: Symbian App private path and build changes (Pankaj Yadav )

git at videolan.org git at videolan.org
Mon Jan 10 23:31:02 CET 2011


vlc | branch: master | Pankaj Yadav <pk at videolan.org> | Mon Jan 10 03:17:33 2011 +0530| [c1a3bb47846f913493a5fa240cbcf403c9f21a5e] | committer: Jean-Baptiste Kempf 

Symbian App private path and build changes

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c1a3bb47846f913493a5fa240cbcf403c9f21a5e
---

 src/Makefile.am      |    9 +++++
 src/symbian/path.cpp |   94 ++++++++++++++++++++++++++++++++++++++++++++++++++
 src/symbian/path.h   |   22 ++++++++++++
 3 files changed, 125 insertions(+), 0 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
old mode 100644
new mode 100755
index edc4dbe..a445751
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -238,6 +238,7 @@ EXTRA_libvlccore_la_SOURCES = \
 	$(SOURCES_libvlc_darwin) \
 	$(SOURCES_libvlc_linux) \
 	$(SOURCES_libvlc_win32) \
+	$(SOURCES_libvlc_symbian) \
 	$(SOURCES_libvlc_other) \
 	$(SOURCES_libvlc_httpd) \
 	$(SOURCES_libvlc_sout) \
@@ -255,11 +256,15 @@ else
 if HAVE_WINCE
 libvlccore_la_SOURCES += $(SOURCES_libvlc_win32)
 else
+if HAVE_SYMBIAN
+libvlccore_la_SOURCES += $(SOURCES_libvlc_symbian)
+else
 libvlccore_la_SOURCES += $(SOURCES_libvlc_other)
 endif
 endif
 endif
 endif
+endif
 if BUILD_HTTPD
 libvlccore_la_SOURCES += $(SOURCES_libvlc_httpd)
 endif
@@ -295,6 +300,10 @@ SOURCES_libvlc_win32 = \
 	win32/winsock.c \
 	$(NULL)
 
+SOURCES_libvlc_symbian = \
+	symbian/path.cpp \
+	$(NULL)
+
 SOURCES_libvlc_other = \
 	config/dirs_xdg.c \
 	misc/atomic.c \
diff --git a/src/symbian/path.cpp b/src/symbian/path.cpp
new file mode 100755
index 0000000..650be89
--- /dev/null
+++ b/src/symbian/path.cpp
@@ -0,0 +1,94 @@
+/*****************************************************************************
+ * path.cpp : Symbian Application's Provate Path
+ *****************************************************************************
+ * Copyright © 2010 Pankaj Yadav
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#include <f32file.h>
+#include <e32base.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <string.h>
+#include <utf.h>
+
+#include "path.h"
+
+/*Way to Find AppPrivatePath (A Path where an application can store its private data) */
+static TInt GetPrivatePath(TFileName& privatePath)
+{
+    TFileName KPath;
+    RFs fsSession;
+    TInt result;
+
+    result = fsSession.Connect();
+    if (result != KErrNone)
+    {
+        return result;
+    }
+    fsSession.PrivatePath(KPath);
+    TFindFile findFile(fsSession);
+
+    privatePath = KPath;
+    result = findFile.FindByDir(KPath, KNullDesC);
+    if (result == KErrNone)
+    {
+        privatePath = findFile.File();
+    }
+
+    fsSession.Close();
+    return result;
+}
+
+extern "C" char * GetConstPrivatePath(void)
+{
+    TFileName privatePath;
+    TBuf8<KMaxFileName> privatepathutf8;
+    size_t len;
+    char carray[KMaxFileName];
+
+    if(GetPrivatePath(privatePath)!=KErrNone)
+    {
+        goto defaultreturn;
+    }
+
+    CnvUtfConverter::ConvertFromUnicodeToUtf8( privatepathutf8, privatePath );
+
+    TInt index = 0;
+    for(index =0 ; index < privatepathutf8.Length(); index++)
+    {
+        carray[index] = privatepathutf8[index];
+    }
+    carray[index] = 0;
+
+    if((len = strnlen((const char *)carray, KMaxFileName) < KMaxFileName)
+    {
+        carray[len-1]='\0';
+    }
+    else
+    {
+        goto defaultreturn;
+    }
+
+
+    return strdup((const char *)carray);
+
+defaultreturn:
+    return strdup("C:\\Data\\Others");
+}
+
diff --git a/src/symbian/path.h b/src/symbian/path.h
new file mode 100755
index 0000000..a71de27
--- /dev/null
+++ b/src/symbian/path.h
@@ -0,0 +1,22 @@
+/*****************************************************************************
+ * path.h: Symbian Aplications Private Path
+ *****************************************************************************
+ * Copyright © 2010 Pankaj Yadav
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+extern "C" char * GetConstPrivatePath(void);
+



More information about the vlc-commits mailing list