亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? nsnetscapeprofilemigratorbase.cpp

?? 現(xiàn)在很火的郵件客戶端軟件thunderbird的源碼
?? CPP
字號(hào):
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- *//* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is The Browser Profile Migrator. * * The Initial Developer of the Original Code is Ben Goodger. * Portions created by the Initial Developer are Copyright (C) 2004 * the Initial Developer. All Rights Reserved. * * Contributor(s): *  Ben Goodger <ben@bengoodger.com> *  Scott MacGregor <mscott@mozilla.org> * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */#include "nsAppDirectoryServiceDefs.h"#include "nsCRT.h"#include "nsIFile.h"#include "nsIInputStream.h"#include "nsILineInputStream.h"#include "nsInt64.h"#include "nsIPrefBranch.h"#include "nsIPrefLocalizedString.h"#include "nsIPrefService.h"#include "nsIRDFService.h"#include "nsIRegistry.h"#include "nsIServiceManager.h"#include "nsISupportsArray.h"#include "nsISupportsPrimitives.h"#include "nsIURL.h"#include "nsNetscapeProfileMigratorBase.h"#include "nsNetUtil.h"#include "nsReadableUtils.h"#include "nsXPIDLString.h"#include "prtime.h"#include "prprf.h"#include "nsVoidArray.h"static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);#define MIGRATION_BUNDLE "chrome://messenger/locale/migration/migration.properties"#define FILE_NAME_PREFS_5X NS_LITERAL_STRING("prefs.js")///////////////////////////////////////////////////////////////////////////////// nsNetscapeProfileMigratorBasensNetscapeProfileMigratorBase::nsNetscapeProfileMigratorBase(){  nsCOMPtr<nsIStringBundleService> bundleService(do_GetService(kStringBundleServiceCID));  bundleService->CreateBundle(MIGRATION_BUNDLE, getter_AddRefs(mBundle));  // create the array we'll be using to keep track of the asynchronous file copy routines  mFileCopyTransactions = new nsVoidArray();  mFileCopyTransactionIndex = 0;}nsresultnsNetscapeProfileMigratorBase::GetProfileDataFromRegistry(nsILocalFile* aRegistryFile,                                                          nsISupportsArray* aProfileNames,                                                          nsISupportsArray* aProfileLocations){  nsresult rv = NS_OK;  // Open It  nsCOMPtr<nsIRegistry> reg(do_CreateInstance("@mozilla.org/registry;1"));  reg->Open(aRegistryFile);  nsRegistryKey profilesTree;  rv = reg->GetKey(nsIRegistry::Common, NS_LITERAL_STRING("Profiles").get(), &profilesTree);  if (NS_FAILED(rv)) return rv;  nsCOMPtr<nsIEnumerator> keys;  reg->EnumerateSubtrees(profilesTree, getter_AddRefs(keys));  keys->First();  while (keys->IsDone() != NS_OK) {    nsCOMPtr<nsISupports> key;    keys->CurrentItem(getter_AddRefs(key));    nsCOMPtr<nsIRegistryNode> node(do_QueryInterface(key));    nsRegistryKey profile;    node->GetKey(&profile);    // "migrated" is "yes" for all valid Seamonkey profiles. It is only "no"    // for 4.x profiles.     nsXPIDLString isMigrated;    reg->GetString(profile, NS_LITERAL_STRING("migrated").get(), getter_Copies(isMigrated));    if (isMigrated.Equals(NS_LITERAL_STRING("no"))) {      keys->Next();      continue;    }    // Get the profile name and add it to the names array    nsXPIDLString profileName;    node->GetName(getter_Copies(profileName));    // Get the profile location and add it to the locations array    nsXPIDLString directory;    reg->GetString(profile, NS_LITERAL_STRING("directory").get(), getter_Copies(directory));    nsCOMPtr<nsILocalFile> dir;#ifdef XP_MACOSX    rv = NS_NewNativeLocalFile(EmptyCString(), PR_TRUE, getter_AddRefs(dir));    if (NS_FAILED(rv)) return rv;    dir->SetPersistentDescriptor(NS_LossyConvertUCS2toASCII(directory));#else    rv = NS_NewLocalFile(directory, PR_TRUE, getter_AddRefs(dir));    if (NS_FAILED(rv)) return rv;#endif    PRBool exists;    dir->Exists(&exists);    if (exists) {      nsCOMPtr<nsISupportsString> profileNameString(do_CreateInstance("@mozilla.org/supports-string;1"));      profileNameString->SetData(profileName);      aProfileNames->AppendElement(profileNameString);      aProfileLocations->AppendElement(dir);    }    keys->Next();  }  return rv;}#define GETPREF(xform, method, value) \  nsresult rv = aBranch->method(xform->sourcePrefName, value); \  if (NS_SUCCEEDED(rv)) \    xform->prefHasValue = PR_TRUE; \  return rv;#define SETPREF(xform, method, value) \  if (xform->prefHasValue) { \    return aBranch->method(xform->targetPrefName ? xform->targetPrefName : xform->sourcePrefName, value); \  } \  return NS_OK;nsresult nsNetscapeProfileMigratorBase::GetString(void* aTransform, nsIPrefBranch* aBranch){  PrefTransform* xform = (PrefTransform*)aTransform;  GETPREF(xform, GetCharPref, &xform->stringValue);}nsresult nsNetscapeProfileMigratorBase::SetString(void* aTransform, nsIPrefBranch* aBranch){  PrefTransform* xform = (PrefTransform*)aTransform;  SETPREF(xform, SetCharPref, xform->stringValue);}nsresultnsNetscapeProfileMigratorBase::GetWString(void* aTransform, nsIPrefBranch* aBranch){  PrefTransform* xform = (PrefTransform*)aTransform;  nsCOMPtr<nsIPrefLocalizedString> prefValue;  nsresult rv = aBranch->GetComplexValue(xform->sourcePrefName,                                          NS_GET_IID(nsIPrefLocalizedString),                                         getter_AddRefs(prefValue));  if (NS_SUCCEEDED(rv) && prefValue) {    nsXPIDLString data;    prefValue->ToString(getter_Copies(data));    xform->stringValue = ToNewCString(NS_ConvertUCS2toUTF8(data));    xform->prefHasValue = PR_TRUE;  }  return rv;}nsresult nsNetscapeProfileMigratorBase::SetWStringFromASCII(void* aTransform, nsIPrefBranch* aBranch){  PrefTransform* xform = (PrefTransform*)aTransform;  if (xform->prefHasValue) {    nsCOMPtr<nsIPrefLocalizedString> pls(do_CreateInstance("@mozilla.org/pref-localizedstring;1"));    nsAutoString data; data.AssignWithConversion(xform->stringValue);    pls->SetData(data.get());    return aBranch->SetComplexValue(xform->targetPrefName ? xform->targetPrefName : xform->sourcePrefName, NS_GET_IID(nsIPrefLocalizedString), pls);  }  return NS_OK;}nsresultnsNetscapeProfileMigratorBase::SetWString(void* aTransform, nsIPrefBranch* aBranch){  PrefTransform* xform = (PrefTransform*)aTransform;  if (xform->prefHasValue) {    nsCOMPtr<nsIPrefLocalizedString> pls(do_CreateInstance("@mozilla.org/pref-localizedstring;1"));    nsAutoString data = NS_ConvertUTF8toUCS2(xform->stringValue);    pls->SetData(data.get());    return aBranch->SetComplexValue(xform->targetPrefName ? xform->targetPrefName : xform->sourcePrefName, NS_GET_IID(nsIPrefLocalizedString), pls);  }  return NS_OK;}nsresult nsNetscapeProfileMigratorBase::GetBool(void* aTransform, nsIPrefBranch* aBranch){  PrefTransform* xform = (PrefTransform*)aTransform;  GETPREF(xform, GetBoolPref, &xform->boolValue);}nsresult nsNetscapeProfileMigratorBase::SetBool(void* aTransform, nsIPrefBranch* aBranch){  PrefTransform* xform = (PrefTransform*)aTransform;  SETPREF(xform, SetBoolPref, xform->boolValue);}nsresult nsNetscapeProfileMigratorBase::GetInt(void* aTransform, nsIPrefBranch* aBranch){  PrefTransform* xform = (PrefTransform*)aTransform;  GETPREF(xform, GetIntPref, &xform->intValue);}nsresult nsNetscapeProfileMigratorBase::SetInt(void* aTransform, nsIPrefBranch* aBranch){  PrefTransform* xform = (PrefTransform*)aTransform;  SETPREF(xform, SetIntPref, xform->intValue);}nsresultnsNetscapeProfileMigratorBase::CopyFile(const nsAString& aSourceFileName, const nsAString& aTargetFileName){  nsCOMPtr<nsIFile> sourceFile;  mSourceProfile->Clone(getter_AddRefs(sourceFile));  sourceFile->Append(aSourceFileName);  PRBool exists = PR_FALSE;  sourceFile->Exists(&exists);  if (!exists)    return NS_OK;  nsCOMPtr<nsIFile> targetFile;  mTargetProfile->Clone(getter_AddRefs(targetFile));    targetFile->Append(aTargetFileName);  targetFile->Exists(&exists);  if (exists)    targetFile->Remove(PR_FALSE);  return sourceFile->CopyTo(mTargetProfile, aTargetFileName);}nsresultnsNetscapeProfileMigratorBase::GetSignonFileName(PRBool aReplace, char** aFileName){  nsresult rv;  if (aReplace) {    // Find out what the signons file was called, this is stored in a pref    // in Seamonkey.    nsCOMPtr<nsIPrefService> psvc(do_GetService(NS_PREFSERVICE_CONTRACTID));    psvc->ResetPrefs();    nsCOMPtr<nsIFile> sourcePrefsName;    mSourceProfile->Clone(getter_AddRefs(sourcePrefsName));    sourcePrefsName->Append(FILE_NAME_PREFS_5X);    psvc->ReadUserPrefs(sourcePrefsName);    nsCOMPtr<nsIPrefBranch> branch(do_QueryInterface(psvc));    rv = branch->GetCharPref("signon.SignonFileName", aFileName);  }  else     rv = LocateSignonsFile(aFileName);  return rv;}nsresultnsNetscapeProfileMigratorBase::LocateSignonsFile(char** aResult){  nsCOMPtr<nsISimpleEnumerator> entries;  nsresult rv = mSourceProfile->GetDirectoryEntries(getter_AddRefs(entries));  if (NS_FAILED(rv)) return rv;  nsCAutoString fileName;  do {    PRBool hasMore = PR_FALSE;    rv = entries->HasMoreElements(&hasMore);    if (NS_FAILED(rv) || !hasMore) break;    nsCOMPtr<nsISupports> supp;    rv = entries->GetNext(getter_AddRefs(supp));    if (NS_FAILED(rv)) break;    nsCOMPtr<nsIFile> currFile(do_QueryInterface(supp));    nsCOMPtr<nsIURI> uri;    rv = NS_NewFileURI(getter_AddRefs(uri), currFile);    if (NS_FAILED(rv)) break;    nsCOMPtr<nsIURL> url(do_QueryInterface(uri));    nsCAutoString extn;    url->GetFileExtension(extn);    if (extn.EqualsIgnoreCase("s")) {      url->GetFileName(fileName);      break;    }  }  while (1);  *aResult = ToNewCString(fileName);  return NS_OK;}// helper function, copies the contents of srcDir into destDir.// destDir will be created if it doesn't exist.nsresult nsNetscapeProfileMigratorBase::RecursiveCopy(nsIFile* srcDir, nsIFile* destDir){  nsresult rv;  PRBool isDir;    rv = srcDir->IsDirectory(&isDir);  if (NS_FAILED(rv)) return rv;  if (!isDir) return NS_ERROR_INVALID_ARG;    PRBool exists;  rv = destDir->Exists(&exists);  if (NS_SUCCEEDED(rv) && !exists)    rv = destDir->Create(nsIFile::DIRECTORY_TYPE, 0775);  if (NS_FAILED(rv)) return rv;    PRBool hasMore = PR_FALSE;  nsCOMPtr<nsISimpleEnumerator> dirIterator;  rv = srcDir->GetDirectoryEntries(getter_AddRefs(dirIterator));  if (NS_FAILED(rv)) return rv;    rv = dirIterator->HasMoreElements(&hasMore);  if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsIFile> dirEntry;    while (hasMore)  {    rv = dirIterator->GetNext((nsISupports**)getter_AddRefs(dirEntry));    if (NS_SUCCEEDED(rv))    {      rv = dirEntry->IsDirectory(&isDir);      if (NS_SUCCEEDED(rv))      {        if (isDir)        {          nsCOMPtr<nsIFile> destClone;          rv = destDir->Clone(getter_AddRefs(destClone));          if (NS_SUCCEEDED(rv))          {            nsCOMPtr<nsILocalFile> newChild(do_QueryInterface(destClone));            nsAutoString leafName;            dirEntry->GetLeafName(leafName);            newChild->AppendRelativePath(leafName);            rv = newChild->Exists(&exists);            if (NS_SUCCEEDED(rv) && !exists)              rv = newChild->Create(nsIFile::DIRECTORY_TYPE, 0775);            rv = RecursiveCopy(dirEntry, newChild);          }        }        else        {          // we aren't going to do any actual file copying here. Instead, add this to our          // file transaction list so we can copy files asynchronously...          fileTransactionEntry* fileEntry = new fileTransactionEntry;          fileEntry->srcFile = dirEntry;          fileEntry->destFile = destDir;          mFileCopyTransactions->AppendElement((void*) fileEntry);        }      }          }    rv = dirIterator->HasMoreElements(&hasMore);    if (NS_FAILED(rv)) return rv;  }    return rv;}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品视频123区在线观看| 精品国产一区二区三区久久影院| 久久久777精品电影网影网| 国产二区国产一区在线观看| 18涩涩午夜精品.www| 欧美日韩国产首页| 亚洲18色成人| 国产精品乱码一区二三区小蝌蚪| 1024成人网色www| 69堂精品视频| www.欧美日韩国产在线| 免费成人在线视频观看| 亚洲人成在线播放网站岛国| 国产激情视频一区二区在线观看| 天天综合天天综合色| 亚洲欧洲三级电影| 久久免费视频一区| 欧美电影在线免费观看| 91丨国产丨九色丨pron| 国产麻豆精品一区二区| 午夜婷婷国产麻豆精品| 一区二区三区四区在线| 欧美国产日产图区| 久久综合五月天婷婷伊人| 欧美日韩亚洲另类| 在线成人免费视频| 4hu四虎永久在线影院成人| 色综合视频一区二区三区高清| 免费欧美日韩国产三级电影| 亚洲品质自拍视频网站| 国产精品家庭影院| 亚洲精品水蜜桃| 亚洲一区二区精品久久av| 亚洲午夜激情网页| 日韩国产在线观看一区| 激情亚洲综合在线| 国产精品一区二区不卡| 国产精品亚洲专一区二区三区| 国产麻豆91精品| 久久国产精品第一页| 韩国中文字幕2020精品| 成人av电影在线播放| 欧美成人性战久久| 国产欧美一区二区三区在线看蜜臀| 久久丝袜美腿综合| 亚洲欧美色一区| 日本在线播放一区二区三区| 日韩av一级电影| 99久久精品一区二区| 日韩视频一区二区三区| 国产午夜亚洲精品羞羞网站| 午夜精品久久久久久久99水蜜桃| 国产乱对白刺激视频不卡| 91在线观看免费视频| 日韩女优av电影在线观看| 最新国产精品久久精品| 精品综合久久久久久8888| 一本大道av伊人久久综合| 精品日韩欧美一区二区| 亚洲在线观看免费| 亚洲va在线va天堂| 国产91丝袜在线18| 久久久久久久久99精品| 亚洲精品久久嫩草网站秘色| 国产成人精品免费| 欧美久久久久久久久中文字幕| 精品国产91亚洲一区二区三区婷婷| 亚洲一区中文日韩| 一本大道久久a久久综合婷婷| 精品国产青草久久久久福利| 亚洲欧美日韩一区二区| 成人性视频免费网站| 日韩一区二区电影在线| 亚洲欧洲成人自拍| 国产精品一区二区视频| 久久综合九色综合97婷婷| 日本欧美韩国一区三区| 欧美性一二三区| 久久综合九色综合欧美就去吻| 亚洲一二三区在线观看| 欧美性生交片4| 一区二区三区四区不卡在线| 久久精品国产**网站演员| 色哟哟一区二区在线观看| 亚洲成人在线观看视频| 日产国产高清一区二区三区| 欧美一区二区私人影院日本| 精品在线免费视频| 综合久久综合久久| 国产精品99久久久| 欧美绝品在线观看成人午夜影视| 免费观看成人鲁鲁鲁鲁鲁视频| 欧美群妇大交群中文字幕| 精品一区二区影视| 最新高清无码专区| 91麻豆精品久久久久蜜臀| 美女国产一区二区| 亚洲欧美日韩一区| 日韩欧美一级二级三级| 国产黑丝在线一区二区三区| 亚洲欧美激情小说另类| 日韩午夜精品视频| 色婷婷激情久久| 黄色精品一二区| 亚洲国产一区二区三区青草影视| 欧美va亚洲va香蕉在线| 91在线免费播放| 欧美aaaaa成人免费观看视频| 精品国精品自拍自在线| 国产成人午夜精品影院观看视频 | 欧美综合亚洲图片综合区| 午夜影院在线观看欧美| 国产精品国产a| 91精品国产黑色紧身裤美女| 国产乱国产乱300精品| 奇米色一区二区三区四区| 国产精品国产自产拍在线| 日韩色视频在线观看| 国产福利一区二区| 麻豆国产欧美日韩综合精品二区 | 欧美草草影院在线视频| 欧美色图在线观看| 成人精品国产一区二区4080| 一区二区激情视频| 亚洲一区在线电影| 亚洲日穴在线视频| 久久久99精品久久| 国产精品久久福利| 中文av一区二区| 中文字幕亚洲区| 亚洲国产精品高清| 久久久美女艺术照精彩视频福利播放| 日韩精品中文字幕一区二区三区| av电影在线观看完整版一区二区| 国产成人精品亚洲777人妖| 成人国产精品免费网站| 成人精品视频一区| 色综合久久久久| 91麻豆精品久久久久蜜臀| 欧美日韩在线直播| 欧美一区二区三区人| xf在线a精品一区二区视频网站| 国产欧美日韩麻豆91| 国产精品二三区| 日本欧美肥老太交大片| 久久丁香综合五月国产三级网站 | 久久久久久日产精品| 国产精品久久久久久久久晋中 | 国产精品一区在线观看你懂的| 97久久超碰国产精品| 91 com成人网| 日韩视频一区在线观看| 亚洲激情综合网| 国产精品美女久久久久久久网站| 日本一区二区三区四区在线视频 | 日韩精品久久久久久| 国产成人亚洲综合a∨猫咪| 日本高清视频一区二区| 欧美电影精品一区二区| 国产精品乱人伦| 国内精品久久久久影院色| 91老师国产黑色丝袜在线| 欧美一级高清片在线观看| 综合久久综合久久| 精品一区二区免费在线观看| 一本色道久久综合亚洲91| 国产精品欧美一级免费| 国产不卡视频在线播放| 日韩一区二区三| 亚洲三级电影网站| 懂色av中文一区二区三区| 欧美一级二级在线观看| 一个色综合网站| 91污片在线观看| 日韩女同互慰一区二区| 伊人一区二区三区| jlzzjlzz亚洲女人18| 亚洲欧洲韩国日本视频| 波多野结衣中文字幕一区| 国产精品久久久一区麻豆最新章节| 日韩高清在线不卡| 97精品超碰一区二区三区| 欧美成人官网二区| 青青青爽久久午夜综合久久午夜 | 一本久道久久综合中文字幕| 久久中文字幕电影| 国产一区在线视频| 久久久久久久久久久久久夜| 激情小说亚洲一区| 国产精品久久一级| 91啦中文在线观看| 日日摸夜夜添夜夜添国产精品| 日本韩国欧美三级| 亚洲精品久久久久久国产精华液| av亚洲精华国产精华精华| 亚洲国产一区视频| 7777精品伊人久久久大香线蕉超级流畅| 日韩av电影免费观看高清完整版在线观看| 91麻豆精品秘密| 亚洲日本在线a|