[Common-dev] CR: Add missing methods to common/fileio

[Common-dev] CR: Add missing methods to common/fileio

Greg Wright gwright at real.com
Tue Mar 16 13:20:03 PST 2004


Cool, looks good then.
--greg.

----- Original Message ----- 
From: "Ryan Gammon" <rgammon at real.com>
To: "Greg Wright" <gwright at real.com>; <dev at common.helixcommunity.org>
Sent: Tuesday, March 16, 2004 1:10 PM
Subject: Re: [Common-dev] CR: Add missing methods to common/fileio


> Greg Wright wrote:
> 
> >Are any of these changes going to affect any of the
> >distribution libs? 
> >
> 
> If they do, it will only be on unix, where the distlibs are currently 
> not working anyway (automated distlib builds are scheduled for later 
> this month).
> 
> >What branches are you planning on
> >check'ing this in for?
> >  
> >
> 
> HEAD
> 
> >You should think about using the standard CR form for
> >your CR submissions.
> >  
> >
> 
> Sorry.
> 
> >These should be HXR_NOTIMPL instead of HXR_FAIL
> >  
> >
> 
> Fair enough. I'll fix the windows variants while I'm at it.
> 
> >the rest looks good.
> >
> >--greg.
> >
> >
> >
> >  
> >
> >>Index: platform/unix/filespecutils_unix.cpp
> >>===================================================================
> >>RCS file: platform/unix/filespecutils_unix.cpp
> >>diff -N platform/unix/filespecutils_unix.cpp
> >>--- /dev/null 1 Jan 1970 00:00:00 -0000
> >>+++ platform/unix/filespecutils_unix.cpp 16 Mar 2004 20:04:49 -0000
> >>@@ -0,0 +1,91 @@
> >>+/* ***** BEGIN LICENSE BLOCK *****
> >>+ * Version: RCSL 1.0/RPSL 1.0
> >>+ *
> >>+ * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved.
> >>+ *
> >>+ * The contents of this file, and the files included with this file, are
> >>+ * subject to the current version of the RealNetworks Public Source License
> >>+ * Version 1.0 (the "RPSL") available at
> >>+ * http://www.helixcommunity.org/content/rpsl unless you have licensed
> >>+ * the file under the RealNetworks Community Source License Version 1.0
> >>+ * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl,
> >>+ * in which case the RCSL will apply. You may also obtain the license terms
> >>+ * directly from RealNetworks.  You may not use this file except in
> >>+ * compliance with the RPSL or, if you have a valid RCSL with RealNetworks
> >>+ * applicable to this file, the RCSL.  Please see the applicable RPSL or
> >>+ * RCSL for the rights, obligations and limitations governing use of the
> >>+ * contents of the file.
> >>+ *
> >>+ * This file is part of the Helix DNA Technology. RealNetworks is the
> >>+ * developer of the Original Code and owns the copyrights in the portions
> >>+ * it created.
> >>+ *
> >>+ * This file, and the files included with this file, is distributed and made
> >>+ * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
> >>+ * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES,
> >>+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
> >>+ * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
> >>+ *
> >>+ * Technology Compatibility Kit Test Suite(s) Location:
> >>+ *    http://www.helixcommunity.org/content/tck
> >>+ *
> >>+ * Contributor(s):
> >>+ *
> >>+ * ***** END LICENSE BLOCK ***** */
> >>+
> >>+#include "filespec.h"
> >>+#include "filespecutils.h"
> >>+
> >>+#include "hxstring.h"
> >>+
> >>+// ------------------------------------------------------------------------------------
> >>+//
> >>+// RenameMoveFile
> >>+//
> >>+// ------------------------------------------------------------------------------------
> >>+
> >>+HX_RESULT CHXFileSpecUtils::RenameMoveFile(CHXFileSpecifier& fileSpec, const char* pNewNameIfAny,
> >>+        const CHXDirSpecifier* pNewDirectoryIfAny)
> >>+{
> >>+        HX_RESULT               res;
> >>+        CHXDirSpecifier         fileDir, destDir;
> >>+        CHXFileSpecifier        interimFileSpec;
> >>+        CHXString               strNewName, strNewPathName, strOldPathName;
> >>+        int                     nResult;
> >>+
> >>+        res = HXR_FAIL;
> >>+
> >>+        require_return(fileSpec.IsSet(), HXR_INVALID_PARAMETER);
> >>+
> >>+        fileDir = fileSpec.GetParentDirectory();
> >>+
> >>+        if (pNewDirectoryIfAny)
> >>+        {
> >>+                destDir = *pNewDirectoryIfAny;
> >>+        }
> >>+        else
> >>+        {
> >>+                destDir = fileDir;
> >>+        }
> >>+
> >>+        if (pNewNameIfAny)
> >>+        {
> >>+                strNewName = pNewNameIfAny;
> >>+        }
> >>+        else
> >>+        {
> >>+                strNewName = fileSpec.GetName();
> >>+        }
> >>+
> >>+        strOldPathName = fileSpec.GetPathName();
> >>+        strNewPathName = destDir.GetPathName();
> >>+        strNewPathName += strNewName;
> >>+
> >>+        nResult = rename(strOldPathName, strNewPathName);
> >>+        if(nResult == 0)
> >>+        {
> >>+            res = HXR_OK;
> >>+        }
> >>+
> >>+        return res;
> >>+}
> >>Index: pub/filespecutils.h
> >>===================================================================
> >>RCS file: /cvsroot/common/fileio/pub/filespecutils.h,v
> >>retrieving revision 1.4
> >>diff -u -w -r1.4 filespecutils.h
> >>--- pub/filespecutils.h 18 Jul 2003 20:33:32 -0000 1.4
> >>+++ pub/filespecutils.h 16 Mar 2004 20:04:49 -0000
> >>@@ -71,6 +71,9 @@
> >>  // these should be implemented on other platforms too, eventually
> >>  static HX_RESULT MakeFileReadOnly(const CHXFileSpecifier& fileSpec);
> >>  static HX_RESULT MakeFileNotReadOnly(const CHXFileSpecifier& fileSpec);
> >>+#endif
> >>+
> >>+#if defined(_MACINTOSH) || defined(_MAC_UNIX) || defined(_UNIX)
> >>  static HX_RESULT RenameMoveFile(CHXFileSpecifier& fileSpec, const char* pNewNameIfAny, const CHXDirSpecifier*
> >>    
> >>
> >pNewDirectoryIfAny);
> >  
> >
> >> #endif
> >>
> >>
> >>    
> >>
> >
> >
> >--------------------------------------------------------------------------------
> >
> >
> >  
> >
> >>_______________________________________________
> >>Common-dev mailing list
> >>Common-dev at lists.helixcommunity.org
> >>http://lists.helixcommunity.org/mailman/listinfo/common-dev
> >>
> >>    
> >>
> >
> >
> >  
> >
> 
> -- 
> Ryan Gammon
> rgammon at real.com
> Developer for Helix Player
> https://player.helixcommunity.org
> 



More information about the Common-dev mailing list
 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

Copyright © 1995-2007 RealNetworks, Inc. All rights reserved. RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.